Sha256: 6932b9f825e620f3a448d750a3b939ea0a5e1bb56951fadb8a4e7254fe9d9b79

Contents?: true

Size: 874 Bytes

Versions: 37

Compression:

Stored size: 874 Bytes

Contents

module Flydata
module Parser

class SourceTable
  def initialize(table_name, columns = {})
    @table_name = table_name
    @columns = columns
    @column_names = columns.collect{|k,v| v[:column_name]}
    @primary_keys = [] # no longer used.  keeping the instance variable for
                       # mashall dump compatibility
    @value_converters = {}
  end

  attr_accessor :table_name, :column_names, :value_converters

  def add_column(column)
    cn = column[:column_name]
    @columns[cn] = column
    @column_names << cn
  end

  def set_value_converters(converter_hash)
    @value_converters ||= {}  # for backward compatibility with an old marshal dump object
    @columns.each_with_index do |(k, v), i|
      type = v[:format_type]
      if converter_hash.has_key?(type)
        @value_converters[i] = converter_hash[type]
      end
    end
  end
end

end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
flydata-0.7.13 lib/flydata/parser/source_table.rb
flydata-0.7.12 lib/flydata/parser/source_table.rb
flydata-0.7.11 lib/flydata/parser/source_table.rb
flydata-0.7.10 lib/flydata/parser/source_table.rb
flydata-0.7.9 lib/flydata/parser/source_table.rb
flydata-0.7.8 lib/flydata/parser/source_table.rb
flydata-0.7.7 lib/flydata/parser/source_table.rb
flydata-0.7.6 lib/flydata/parser/source_table.rb
flydata-0.7.5 lib/flydata/parser/source_table.rb
flydata-0.7.4 lib/flydata/parser/source_table.rb
flydata-0.7.2.1 lib/flydata/parser/source_table.rb
flydata-0.7.2 lib/flydata/parser/source_table.rb
flydata-0.7.1 lib/flydata/parser/source_table.rb
flydata-0.7.0 lib/flydata/parser/source_table.rb
flydata-0.6.14 lib/flydata/parser/source_table.rb
flydata-0.6.13 lib/flydata/parser/source_table.rb
flydata-0.6.12 lib/flydata/parser/source_table.rb