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(column_info) ⇒ SingleColumn
constructor
A new instance of SingleColumn.
Constructor Details
#initialize(column_info) ⇒ SingleColumn
Returns a new instance of SingleColumn.
86 87 88 |
# File 'lib/simple/sql/helpers/decoder.rb', line 86 def initialize(column_info) @field_type = column_info.first.fetch(:pg_type_name) end |
Instance Method Details
#decode(row) ⇒ Object
90 91 92 93 |
# File 'lib/simple/sql/helpers/decoder.rb', line 90 def decode(row) value = row.first value && Simple::SQL::Helpers::Decoder.decode_value(@field_type, value) end |