Method: Atom::Source#initialize
- Defined in:
- lib/atom.rb
#initialize(o = nil) {|_self| ... } ⇒ Source
Returns a new instance of Source.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/atom.rb', line 312 def initialize(o = nil) , @contributors, @links = [], [], Links.new case o when XML::Reader unless current_node_is?(o, 'source', NAMESPACE) raise ArgumentError, "Invalid node for atom:source - #{o.name}(#{o.namespace})" end o.read parse(o) when Hash o.each do |k, v| self.send("#{k.to_s}=", v) end end yield(self) if block_given? end |