Class: DBF::Database::Table

Inherits:
Table
  • Object
show all
Defined in:
lib/dbf/database/foxpro.rb

Constant Summary

Constants inherited from Table

Table::DBASE2_HEADER_SIZE, Table::DBASE3_HEADER_SIZE, Table::DBASE7_HEADER_SIZE, Table::FOXPRO_VERSIONS, Table::VERSIONS

Constants included from Schema

Schema::FORMATS, Schema::OTHER_DATA_TYPES

Instance Attribute Summary collapse

Attributes inherited from Table

#encoding, #name

Instance Method Summary collapse

Methods inherited from Table

#close, #closed?, #column_names, #columns, #each, #filename, #find, #has_memo_file?, #initialize, #record, #to_csv, #version_description

Methods included from Schema

#activerecord_schema, #activerecord_schema_definition, #json_schema, #number_data_type, #schema, #schema_data_type, #schema_name, #sequel_schema, #sequel_schema_definition, #string_data_format

Constructor Details

This class inherits a constructor from DBF::Table

Instance Attribute Details

#long_namesObject

Returns the value of attribute long_names.



113
114
115
# File 'lib/dbf/database/foxpro.rb', line 113

def long_names
  @long_names
end

Instance Method Details

#build_columnsObject

:nodoc:



115
116
117
118
119
120
121
122
123
124
# File 'lib/dbf/database/foxpro.rb', line 115

def build_columns # :nodoc:
  columns = super

  # modify the column definitions to use the long names as the
  # columnname property is readonly, recreate the column definitions
  columns.map do |column|
    long_name = long_names[columns.index(column)]
    Column.new(self, long_name, column.type, column.length, column.decimal)
  end
end