Class: Syndication::Atom::Category
- Defined in:
- lib/syndication/atom.rb
Overview
A category (keyword) in an Atom feed. For convenience, Category#to_s is the same as Category#label.
Instance Attribute Summary collapse
-
#label ⇒ Object
(also: #to_s)
A human-readable version of Category#term.
-
#scheme ⇒ Object
URI to the schema definition.
-
#term ⇒ Object
The category itself, possibly encoded.
Instance Method Summary collapse
-
#initialize(parent, tag, attrs = nil) ⇒ Category
constructor
:stopdoc: parent = parent object tag = XML tag which caused creation of this object attrs = XML attributes as a hash.
Methods inherited from Container
#parse_date, #store, #store_category, #strip, #tag2method, #tag_end, #tag_start
Constructor Details
#initialize(parent, tag, attrs = nil) ⇒ Category
:stopdoc: parent = parent object tag = XML tag which caused creation of this object attrs = XML attributes as a hash
285 286 287 288 289 290 291 292 293 |
# File 'lib/syndication/atom.rb', line 285 def initialize(parent, tag, attrs = nil) @tag = tag @parent = parent if attrs attrs.each_pair {|key, value| self.store(key, value) } end end |
Instance Attribute Details
#label ⇒ Object Also known as: to_s
A human-readable version of Category#term.
277 278 279 |
# File 'lib/syndication/atom.rb', line 277 def label @label end |
#scheme ⇒ Object
URI to the schema definition.
279 280 281 |
# File 'lib/syndication/atom.rb', line 279 def scheme @scheme end |
#term ⇒ Object
The category itself, possibly encoded.
275 276 277 |
# File 'lib/syndication/atom.rb', line 275 def term @term end |