Class: Simple::SQL::Helpers::Decoder::MultiColumns
- Inherits:
-
Object
- Object
- Simple::SQL::Helpers::Decoder::MultiColumns
- Defined in:
- lib/simple/sql/helpers/decoder.rb
Direct Known Subclasses
Constant Summary collapse
Instance Method Summary collapse
- #decode(row) ⇒ Object
-
#initialize(column_info) ⇒ MultiColumns
constructor
A new instance of MultiColumns.
Constructor Details
#initialize(column_info) ⇒ MultiColumns
Returns a new instance of MultiColumns.
91 92 93 |
# File 'lib/simple/sql/helpers/decoder.rb', line 91 def initialize(column_info) @field_types = H.pluck(column_info, :pg_type_name) end |
Instance Method Details
#decode(row) ⇒ Object
95 96 97 98 99 |
# File 'lib/simple/sql/helpers/decoder.rb', line 95 def decode(row) @field_types.zip(row).map do |field_type, value| value && Simple::SQL::Helpers::Decoder.decode_value(field_type, value) end end |