Class: Emmental::Row

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, headers) ⇒ Row

Returns a new instance of Row.



5
6
7
8
9
10
11
12
# File 'lib/emmental/row.rb', line 5

def initialize(hash, headers)
  @hash = hash
  @headers = headers

  hash.each_key do |header|
    @headers.add_header(header)
  end
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



3
4
5
# File 'lib/emmental/row.rb', line 3

def headers
  @headers
end

Instance Method Details

#to_hObject



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

def to_h
  @hash
end