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.
78 79 80 |
# File 'lib/simple/sql/helpers/decoder.rb', line 78 def initialize(column_info) @field_type = column_info.first.fetch(:pg_type_name) end |
Instance Method Details
#decode(row) ⇒ Object
82 83 84 85 |
# File 'lib/simple/sql/helpers/decoder.rb', line 82 def decode(row) value = row.first value && Simple::SQL::Helpers::Decoder.decode_value(@field_type, value) end |