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.



96
97
98
99
# File 'lib/simple/sql/decoder.rb', line 96

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

Instance Method Details

#decode(row) ⇒ Object



101
102
103
104
# File 'lib/simple/sql/decoder.rb', line 101

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