Class: Atom::Pub::Service

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

Instance Method Summary collapse

Methods included from Xml::Parseable

#==, #accessor_name, #current_node_is?, included, #next_node_is?, #parse, #to_xml

Constructor Details

#initialize(xml = nil) {|_self| ... } ⇒ Service

Returns a new instance of Service.

Yields:

  • (_self)

Yield Parameters:



36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/atom/pub.rb', line 36

def initialize(xml = nil)
  @workspaces = []

  if xml
    if next_node_is?(xml, 'service', Atom::Pub::NAMESPACE)
      xml.read
      parse(xml)
    else
      raise ArgumentError, "XML document was missing atom:service"
    end
  end

  yield(self) if block_given?
end