Class: XeroGateway::TrackingCategory::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/xero_gateway/tracking_category.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Option

Returns a new instance of Option.



27
28
29
30
31
# File 'lib/xero_gateway/tracking_category.rb', line 27

def initialize(params = {})
  params.each do |k,v|
    self.send("#{k}=", v)
  end
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



25
26
27
# File 'lib/xero_gateway/tracking_category.rb', line 25

def name
  @name
end

#statusObject

Returns the value of attribute status.



25
26
27
# File 'lib/xero_gateway/tracking_category.rb', line 25

def status
  @status
end

#tracking_option_idObject

Returns the value of attribute tracking_option_id.



25
26
27
# File 'lib/xero_gateway/tracking_category.rb', line 25

def tracking_option_id
  @tracking_option_id
end

Class Method Details

.from_xml(option_element) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/xero_gateway/tracking_category.rb', line 33

def self.from_xml(option_element)
  option = Option.new
  option_element.children.each do |element|
    case(element.name)
      when "TrackingOptionID" then option.tracking_option_id = element.text
      when "Name" then option.name = element.text
      when "Status" then option.status = element.text
    end
  end
  option
end