Class: Report::Body::Row
- Inherits:
-
Object
- Object
- Report::Body::Row
- Defined in:
- lib/report/body/row.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#obj ⇒ Object
readonly
Returns the value of attribute obj.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
-
#initialize(body, report, obj) ⇒ Row
constructor
A new instance of Row.
- #to_a ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(body, report, obj) ⇒ Row
Returns a new instance of Row.
7 8 9 10 11 |
# File 'lib/report/body/row.rb', line 7 def initialize(body, report, obj) @body = body @report = report @obj = obj end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/report/body/row.rb', line 4 def body @body end |
#obj ⇒ Object (readonly)
Returns the value of attribute obj.
5 6 7 |
# File 'lib/report/body/row.rb', line 5 def obj @obj end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
6 7 8 |
# File 'lib/report/body/row.rb', line 6 def report @report end |
Instance Method Details
#to_a ⇒ Object
12 13 14 |
# File 'lib/report/body/row.rb', line 12 def to_a body.columns.map { |column| column.read(report, obj) } end |
#to_hash ⇒ Object
15 16 17 18 19 |
# File 'lib/report/body/row.rb', line 15 def to_hash body.columns.map do |column| column. report, obj end end |