Class: XeroGateway::Report::Cell

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/xero_gateway/report/cell.rb

Overview

Adds #attributes to the cells we’re grabbing, since Xero Report Cells use XML like: <Cell>

<Value>Interest Income (270)</Value>
<Attributes>
  <Attribute>
    <Value>e9482110-7245-4a76-bfe2-14500495a076</Value>
    <Id>account</Id>
  </Attribute>
</Attributes>

</Cell>

We delegate to the topmost “<Value>” class and decorate with an “attributes” hash for the “attribute: value” pairs

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, new_attributes = {}) ⇒ Cell

Returns a new instance of Cell.



20
21
22
23
24
# File 'lib/xero_gateway/report/cell.rb', line 20

def initialize(value, new_attributes = {})
  @value        = value
  @attributes   = new_attributes
  super(value)
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



18
19
20
# File 'lib/xero_gateway/report/cell.rb', line 18

def attributes
  @attributes
end

#valueObject (readonly)

Returns the value of attribute value.



18
19
20
# File 'lib/xero_gateway/report/cell.rb', line 18

def value
  @value
end