Class: MWS::Feeds::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/feeds/document.rb

Direct Known Subclasses

Collection, Entity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node, namespace: 'xmlns') ⇒ Document

Returns a new instance of Document.



9
10
11
12
# File 'lib/mws/feeds/document.rb', line 9

def initialize(node, namespace: 'xmlns')
  @node = node
  @namespace = namespace
end

Instance Attribute Details

#namespaceObject (readonly)

Returns the value of attribute namespace.



7
8
9
# File 'lib/mws/feeds/document.rb', line 7

def namespace
  @namespace
end

#nodeObject (readonly)

Returns the value of attribute node.



6
7
8
# File 'lib/mws/feeds/document.rb', line 6

def node
  @node
end

Instance Method Details

#xpath(path) ⇒ Object



14
15
16
# File 'lib/mws/feeds/document.rb', line 14

def xpath(path)
  node.xpath(add_namespace(path))
end