Class: SalsaLabs::ObjectsFetcher::SalsaLabsApiObjectNode
- Inherits:
-
Object
- Object
- SalsaLabs::ObjectsFetcher::SalsaLabsApiObjectNode
- Defined in:
- lib/salsa_labs/objects_fetcher.rb
Overview
Object used to translate API’s XML node into a hash of attributes for SalsaLabs::Action creation.
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(xml_element) ⇒ SalsaLabsApiObjectNode
constructor
A new instance of SalsaLabsApiObjectNode.
Constructor Details
#initialize(xml_element) ⇒ SalsaLabsApiObjectNode
Returns a new instance of SalsaLabsApiObjectNode.
51 52 53 |
# File 'lib/salsa_labs/objects_fetcher.rb', line 51 def initialize(xml_element) @node = xml_element end |
Instance Method Details
#attributes ⇒ Object
55 56 57 58 59 60 |
# File 'lib/salsa_labs/objects_fetcher.rb', line 55 def attributes children.inject({}) do |memo, attribute| memo[attribute.name.downcase] = attribute.text if attribute.element? memo end end |