Class: Adhoq::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header, rows = []) ⇒ Result

Returns a new instance of Result.



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

def initialize(header, rows = [])
  @header = header
  @rows   = rows
end

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



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

def header
  @header
end

#rowsObject (readonly)

Returns the value of attribute rows.



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

def rows
  @rows
end

Instance Method Details

#<<(row) ⇒ Object



10
11
12
# File 'lib/adhoq/result.rb', line 10

def <<(row)
  rows << row
end

#==(obj) ⇒ Object



14
15
16
# File 'lib/adhoq/result.rb', line 14

def ==(obj)
  header == obj.header && rows == obj.rows
end