Class: Simple::SQL::Helpers::Decoder::SingleColumn
- Inherits:
-
Object
- Object
- Simple::SQL::Helpers::Decoder::SingleColumn
- Defined in:
- lib/simple/sql/helpers/decoder.rb
Instance Method Summary collapse
- #decode(row) ⇒ Object
-
#initialize(connection, result) ⇒ SingleColumn
constructor
A new instance of SingleColumn.
Constructor Details
#initialize(connection, result) ⇒ SingleColumn
Returns a new instance of SingleColumn.
78 79 80 81 |
# File 'lib/simple/sql/helpers/decoder.rb', line 78 def initialize(connection, result) typename = connection.resolve_type(result.ftype(0), result.fmod(0)) @field_type = typename.to_sym end |
Instance Method Details
#decode(row) ⇒ Object
83 84 85 86 |
# File 'lib/simple/sql/helpers/decoder.rb', line 83 def decode(row) value = row.first value && Simple::SQL::Helpers::Decoder.decode_value(@field_type, value) end |