1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rss/1.0.rb: added rdf:Bag.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kou 2005-11-17 08:42:13 +00:00
parent 8c84da7bc5
commit 9680ebebe1
2 changed files with 78 additions and 29 deletions

View file

@ -1,3 +1,7 @@
Thu Nov 17 17:40:19 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/1.0.rb: added rdf:Bag.
Thu Nov 17 13:52:00 2005 Kouhei Sutou <kou@cozmixng.org> Thu Nov 17 13:52:00 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb : removed needless argument 'prefix'. * lib/rss/rss.rb : removed needless argument 'prefix'.

View file

@ -95,16 +95,55 @@ module RSS
rv rv
end end
class Seq < Element class Li < Element
include RSS10 include RSS10
class << self class << self
def required_uri def required_uri
URI URI
end end
end
[
["resource", [URI, nil], true]
].each do |name, uri, required|
install_get_attribute(name, uri, required)
end
def initialize(resource=nil)
super()
@resource = resource
end
def full_name
tag_name_with_prefix(PREFIX)
end
def to_s(need_convert=true, indent=calc_indent)
rv = tag(indent)
rv = convert(rv) if need_convert
rv
end
private
def _attrs
[
["resource", true]
]
end
end
class Seq < Element
include RSS10
Li = ::RSS::RDF::Li
class << self
def required_uri
URI
end
end end
@tag_name = 'Seq' @tag_name = 'Seq'
@ -147,49 +186,60 @@ module RSS
end end
rv rv
end end
end end
class Li < Element class Bag < Element
include RSS10 include RSS10
Li = ::RSS::RDF::Li
class << self class << self
def required_uri def required_uri
URI URI
end end
end end
@tag_name = 'Bag'
[ install_have_children_element("li")
["resource", [URI, nil], true]
].each do |name, uri, required|
install_get_attribute(name, uri, required)
end
def initialize(resource=nil) install_must_call_validator('rdf', ::RSS::RDF::URI)
def initialize(li=[])
super() super()
@resource = resource @li = li
end
def to_s(need_convert=true, indent=calc_indent)
tag(indent) do |next_indent|
[
li_elements(need_convert, next_indent),
other_element(need_convert, next_indent),
]
end
end end
def full_name def full_name
tag_name_with_prefix(PREFIX) tag_name_with_prefix(PREFIX)
end end
def to_s(need_convert=true, indent=calc_indent) private
rv = tag(indent) def children
rv = convert(rv) if need_convert @li
rv end
def rdf_validate(tags)
_validate(tags, [["li", '*']])
end end
private def _tags
def _attrs rv = []
[ @li.each do |li|
["resource", true] rv << [URI, "li"]
] end
rv
end end
end end
class Channel < Element class Channel < Element
@ -361,11 +411,6 @@ module RSS
include RSS10 include RSS10
Seq = ::RSS::RDF::Seq Seq = ::RSS::RDF::Seq
class Seq
unless const_defined?(:Li)
Li = ::RSS::RDF::Li
end
end
class << self class << self