Class: Simple::SQL::Decoder::SingleColumn
- Inherits:
-
Object
- Object
- Simple::SQL::Decoder::SingleColumn
- Defined in:
- lib/simple/sql/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.
85 86 87 88 |
# File 'lib/simple/sql/decoder.rb', line 85 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
90 91 92 93 |
# File 'lib/simple/sql/decoder.rb', line 90 def decode(row) value = row.first value && Simple::SQL::Decoder.decode_value(@field_type, value) end |