Class: Report::Body::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/report/body/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#bodyObject (readonly)

Returns the value of attribute body.



4
5
6
# File 'lib/report/body/row.rb', line 4

def body
  @body
end

#objObject (readonly)

Returns the value of attribute obj.



5
6
7
# File 'lib/report/body/row.rb', line 5

def obj
  @obj
end

#reportObject (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_aObject



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

def to_a
  body.columns.map { |column| column.read(report, obj) }
end

#to_hashObject



15
16
17
18
19
# File 'lib/report/body/row.rb', line 15

def to_hash
  body.columns.map do |column|
    column.read_with_options report, obj
  end
end