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.8.10.2 lib/flydata/parser/source_table.rb
flydata-0.8.10.1 lib/flydata/parser/source_table.rb
flydata-0.8.9.11 lib/flydata/parser/source_table.rb
flydata-0.8.10 lib/flydata/parser/source_table.rb
flydata-0.8.9 lib/flydata/parser/source_table.rb
flydata-0.8.8 lib/flydata/parser/source_table.rb
flydata-0.8.7 lib/flydata/parser/source_table.rb
flydata-0.8.6 lib/flydata/parser/source_table.rb
flydata-0.8.5 lib/flydata/parser/source_table.rb
flydata-0.8.4 lib/flydata/parser/source_table.rb
flydata-0.8.3 lib/flydata/parser/source_table.rb
flydata-0.8.2 lib/flydata/parser/source_table.rb
flydata-0.8.1 lib/flydata/parser/source_table.rb
flydata-0.8.0 lib/flydata/parser/source_table.rb
flydata-0.7.19 lib/flydata/parser/source_table.rb
flydata-0.7.18 lib/flydata/parser/source_table.rb
flydata-0.7.17 lib/flydata/parser/source_table.rb
flydata-0.7.16 lib/flydata/parser/source_table.rb
flydata-0.7.15 lib/flydata/parser/source_table.rb
flydata-0.7.14 lib/flydata/parser/source_table.rb