Sha256: 851933ddf0e2d7e6d642f977ad93fad84547b858fb89f43d8045cec48755c31f

Contents?: true

Size: 454 Bytes

Versions: 9

Compression:

Stored size: 454 Bytes

Contents

require 'json'
module IOStreams
  class Tabular
    module Parser
      class Hash < Base
        def parse(row)
          unless row.is_a?(::Hash)
            raise(IOStreams::Errors::TypeMismatch, "Format is :hash. Invalid input: #{row.class.name}")
          end

          row
        end

        def render(row, header)
          header.to_hash(row)
        end

        def requires_header?
          false
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
iostreams-1.1.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta7 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta6 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta5 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta4 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta3 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta2 lib/io_streams/tabular/parser/hash.rb
iostreams-1.0.0.beta lib/io_streams/tabular/parser/hash.rb