Class: MWS::Orders::Document

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

Overview

Wraps a Nokogiri node

Direct Known Subclasses

Collection, Entity

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ Document

Returns a new instance of Document.



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

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



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

def node
  @node
end

Instance Method Details

#at_xpath(path) ⇒ Object



17
18
19
# File 'lib/mws/orders/document.rb', line 17

def at_xpath(path)
  node.at_xpath(add_namespace(path), namespaces)
end

#xpath(path) ⇒ Object



13
14
15
# File 'lib/mws/orders/document.rb', line 13

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