Class: Xeroizer::Report::Row
- Inherits:
-
Object
- Object
- Xeroizer::Report::Row
- Includes:
- RowXmlHelper
- Defined in:
- lib/xeroizer/report/row/row.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cells ⇒ Object
Returns the value of attribute cells.
-
#header ⇒ Object
Returns the value of attribute header.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#rows ⇒ Object
Returns the value of attribute rows.
-
#title ⇒ Object
Returns the value of attribute title.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #cell(column_name) ⇒ Object
- #child? ⇒ Boolean
- #header? ⇒ Boolean
-
#initialize(report) ⇒ Row
constructor
A new instance of Row.
- #parent? ⇒ Boolean
- #row? ⇒ Boolean
- #section? ⇒ Boolean
- #summary? ⇒ Boolean
Methods included from RowXmlHelper
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
#cells ⇒ Object
Returns the value of attribute cells.
14 15 16 |
# File 'lib/xeroizer/report/row/row.rb', line 14 def cells @cells end |
#header ⇒ Object
Returns the value of attribute header.
18 19 20 |
# File 'lib/xeroizer/report/row/row.rb', line 18 def header @header end |
#parent ⇒ Object
Returns the value of attribute parent.
16 17 18 |
# File 'lib/xeroizer/report/row/row.rb', line 16 def parent @parent end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
9 10 11 |
# File 'lib/xeroizer/report/row/row.rb', line 9 def report @report end |
#rows ⇒ Object
Returns the value of attribute rows.
13 14 15 |
# File 'lib/xeroizer/report/row/row.rb', line 13 def rows @rows end |
#title ⇒ Object
Returns the value of attribute title.
12 13 14 |
# File 'lib/xeroizer/report/row/row.rb', line 12 def title @title end |
#type ⇒ Object
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
33 34 35 |
# File 'lib/xeroizer/report/row/row.rb', line 33 def child? !parent.nil? end |
#header? ⇒ Boolean
28 |
# File 'lib/xeroizer/report/row/row.rb', line 28 def header?; @type == 'Header'; end |
#parent? ⇒ Boolean
37 38 39 |
# File 'lib/xeroizer/report/row/row.rb', line 37 def parent? rows.size > 0 end |
#row? ⇒ Boolean
31 |
# File 'lib/xeroizer/report/row/row.rb', line 31 def row?; @type == 'Row'; end |
#section? ⇒ Boolean
30 |
# File 'lib/xeroizer/report/row/row.rb', line 30 def section?; @type == 'Section'; end |
#summary? ⇒ Boolean
29 |
# File 'lib/xeroizer/report/row/row.rb', line 29 def summary?; @type == 'SummaryRow'; end |