Class: Hexspace::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/hexspace/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rows, columns, column_types) ⇒ Result

Returns a new instance of Result.



5
6
7
8
9
# File 'lib/hexspace/result.rb', line 5

def initialize(rows, columns, column_types)
  @rows = rows
  @columns = columns
  @column_types = column_types
end

Instance Attribute Details

#column_typesObject (readonly)

Returns the value of attribute column_types.



3
4
5
# File 'lib/hexspace/result.rb', line 3

def column_types
  @column_types
end

#columnsObject (readonly)

Returns the value of attribute columns.



3
4
5
# File 'lib/hexspace/result.rb', line 3

def columns
  @columns
end

#rowsObject (readonly)

Returns the value of attribute rows.



3
4
5
# File 'lib/hexspace/result.rb', line 3

def rows
  @rows
end

Instance Method Details

#to_aObject



11
12
13
14
15
# File 'lib/hexspace/result.rb', line 11

def to_a
  @rows.map do |row|
    @columns.zip(row).to_h
  end
end