Class: SalsaLabs::ObjectsFetcher::SalsaLabsApiObjectNode

Inherits:
Object
  • Object
show all
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

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

#attributesObject



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