Sha256: 8e99344a636d7b937a59ec1c7e4dd27a1fbb2ef277ea8e78c24f498473b2e58c

Contents?: true

Size: 428 Bytes

Versions: 20

Compression:

Stored size: 428 Bytes

Contents

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

          row
        end

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

        def requires_header?
          false
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
iostreams-1.10.3 lib/io_streams/tabular/parser/hash.rb
iostreams-1.10.2 lib/io_streams/tabular/parser/hash.rb
iostreams-1.10.1 lib/io_streams/tabular/parser/hash.rb
iostreams-1.10.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.9.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.8.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.7.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.6.2 lib/io_streams/tabular/parser/hash.rb
iostreams-1.6.1 lib/io_streams/tabular/parser/hash.rb
iostreams-1.6.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.5.1 lib/io_streams/tabular/parser/hash.rb
iostreams-1.5.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.4.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.3.3 lib/io_streams/tabular/parser/hash.rb
iostreams-1.3.2 lib/io_streams/tabular/parser/hash.rb
iostreams-1.3.1 lib/io_streams/tabular/parser/hash.rb
iostreams-1.3.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.2.1 lib/io_streams/tabular/parser/hash.rb
iostreams-1.2.0 lib/io_streams/tabular/parser/hash.rb
iostreams-1.1.1 lib/io_streams/tabular/parser/hash.rb