Sha256: 4335a0b24ead14a26d2ddb211ae78b70031f88ac73f3013aba13cf611ac39dc2

Contents?: true

Size: 681 Bytes

Versions: 1

Compression:

Stored size: 681 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(Tabular::Errors::InvalidHeader, "Format is :array. Invalid input header: #{row.class.name}") unless row.is_a?(::Array)
          row
        end

        # Returns Array
        def parse(row)
          raise(Tabular::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

1 entries across 1 versions & 1 rubygems

Version Path
iostreams-0.15.0 lib/io_streams/tabular/parser/array.rb