Class: Xeroizer::Report::Row

Inherits:
Object
  • Object
show all
Includes:
RowXmlHelper
Defined in:
lib/xeroizer/report/row/row.rb

Direct Known Subclasses

HeaderRow, SectionRow, SummaryRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RowXmlHelper

included

Constructor Details

#initialize(report) ⇒ Row

Returns a new instance of Row.



22
23
24
25
26
# File 'lib/xeroizer/report/row/row.rb', line 22

def initialize(report)
  @rows = []
  @cells = []
  @report = report
end

Instance Attribute Details

#cellsObject

Returns the value of attribute cells.



14
15
16
# File 'lib/xeroizer/report/row/row.rb', line 14

def cells
  @cells
end

#headerObject

Returns the value of attribute header.



18
19
20
# File 'lib/xeroizer/report/row/row.rb', line 18

def header
  @header
end

#parentObject

Returns the value of attribute parent.



16
17
18
# File 'lib/xeroizer/report/row/row.rb', line 16

def parent
  @parent
end

#reportObject (readonly)

Returns the value of attribute report.



9
10
11
# File 'lib/xeroizer/report/row/row.rb', line 9

def report
  @report
end

#rowsObject

Returns the value of attribute rows.



13
14
15
# File 'lib/xeroizer/report/row/row.rb', line 13

def rows
  @rows
end

#titleObject

Returns the value of attribute title.



12
13
14
# File 'lib/xeroizer/report/row/row.rb', line 12

def title
  @title
end

#typeObject

Returns the value of attribute type.



11
12
13
# File 'lib/xeroizer/report/row/row.rb', line 11

def type
  @type
end

Instance Method Details

#cell(column_name) ⇒ Object



41
42
43
44
# File 'lib/xeroizer/report/row/row.rb', line 41

def cell(column_name)
  index = header.column_index(column_name)
  cells[index] if index >= 0
end

#child?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/xeroizer/report/row/row.rb', line 33

def child?
  !parent.nil?
end

#header?Boolean

Returns:

  • (Boolean)


28
# File 'lib/xeroizer/report/row/row.rb', line 28

def header?;  @type == 'Header';      end

#parent?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/xeroizer/report/row/row.rb', line 37

def parent?
  rows.size > 0
end

#row?Boolean

Returns:

  • (Boolean)


31
# File 'lib/xeroizer/report/row/row.rb', line 31

def row?;     @type == 'Row';         end

#section?Boolean

Returns:

  • (Boolean)


30
# File 'lib/xeroizer/report/row/row.rb', line 30

def section?; @type == 'Section';     end

#summary?Boolean

Returns:

  • (Boolean)


29
# File 'lib/xeroizer/report/row/row.rb', line 29

def summary?; @type == 'SummaryRow';  end