Class: Atom::Category

Inherits:
Object
  • Object
show all
Includes:
SimpleExtensions, Xml::Parseable
Defined in:
lib/atom.rb

Overview

Represents a Category as defined by the Atom Syndication Format specification.

Instance Attribute Summary

Attributes included from SimpleExtensions

#simple_extensions

Instance Method Summary collapse

Methods included from SimpleExtensions

#[]

Constructor Details

#initialize(o = nil) {|_self| ... } ⇒ Category

Returns a new instance of Category.

Yields:

  • (_self)

Yield Parameters:



115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/atom.rb', line 115

def initialize(o = nil)
  case o
  when XML::Reader
    parse(o, :once => true)
  when Hash
    o.each do |k, v|
      self.send("#{k.to_s}=", v)
    end
  end
  
  yield(self) if block_given?
end