Class: Simple::SQL::Decoder::SingleColumn

Inherits:
MultiColumns show all
Defined in:
lib/simple/sql/decoder.rb

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ SingleColumn

Returns a new instance of SingleColumn.



98
99
100
101
# File 'lib/simple/sql/decoder.rb', line 98

def initialize(result)
  super
  @field_type = @field_types.first
end

Instance Method Details

#decode(row) ⇒ Object



103
104
105
106
# File 'lib/simple/sql/decoder.rb', line 103

def decode(row)
  value = row.first
  value && Simple::SQL::Decoder.decode_value(@field_type, value)
end