Sha256: e74c374455e062c810596bf25250e0aaa348964d69d47b63fb924b8d79fddfcb

Contents?: true

Size: 685 Bytes

Versions: 13

Compression:

Stored size: 685 Bytes

Contents

require 'json'
module IOStreams
  class Tabular
    module Parser
      class Array < Base
        # Returns [Array<String>] the header row.
        # Returns nil if the row is blank.
        def parse_header(row)
          raise(IOStreams::Errors::InvalidHeader, "Format is :array. Invalid input header: #{row.class.name}") unless row.is_a?(::Array)
          row
        end

        # Returns Array
        def parse(row)
          raise(IOStreams::Errors::TypeMismatch, "Format is :array. Invalid input: #{row.class.name}") unless row.is_a?(::Array)
          row
        end

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

      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
iostreams-0.20.3 lib/io_streams/tabular/parser/array.rb
iostreams-0.20.2 lib/io_streams/tabular/parser/array.rb
iostreams-0.20.1 lib/io_streams/tabular/parser/array.rb
iostreams-0.20.0 lib/io_streams/tabular/parser/array.rb
iostreams-0.19.0 lib/io_streams/tabular/parser/array.rb
iostreams-0.18.0 lib/io_streams/tabular/parser/array.rb
iostreams-0.17.3 lib/io_streams/tabular/parser/array.rb
iostreams-0.17.2 lib/io_streams/tabular/parser/array.rb
iostreams-0.17.1 lib/io_streams/tabular/parser/array.rb
iostreams-0.17.0 lib/io_streams/tabular/parser/array.rb
iostreams-0.16.2 lib/io_streams/tabular/parser/array.rb
iostreams-0.16.1 lib/io_streams/tabular/parser/array.rb
iostreams-0.16.0 lib/io_streams/tabular/parser/array.rb