Class: Syndication::Atom::Category

Inherits:
Container
  • Object
show all
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

Instance Method Summary collapse

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

#labelObject 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

#schemeObject

URI to the schema definition.



279
280
281
# File 'lib/syndication/atom.rb', line 279

def scheme
  @scheme
end

#termObject

The category itself, possibly encoded.



275
276
277
# File 'lib/syndication/atom.rb', line 275

def term
  @term
end