Class: DBF::Database::Table
- Inherits:
-
Table
- Object
- Table
- DBF::Database::Table
- Defined in:
- lib/dbf/database/foxpro.rb
Instance Attribute Summary collapse
-
#long_names ⇒ Object
readonly
Returns the value of attribute long_names.
Instance Method Summary collapse
-
#build_columns ⇒ Object
:nodoc:.
-
#initialize(path, long_names:) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(path, long_names:) ⇒ Table
Returns a new instance of Table.
97 98 99 100 |
# File 'lib/dbf/database/foxpro.rb', line 97 def initialize(path, long_names:) @long_names = long_names super(path) end |
Instance Attribute Details
#long_names ⇒ Object (readonly)
Returns the value of attribute long_names.
95 96 97 |
# File 'lib/dbf/database/foxpro.rb', line 95 def long_names @long_names end |
Instance Method Details
#build_columns ⇒ Object
:nodoc:
102 103 104 105 106 107 108 109 110 111 |
# File 'lib/dbf/database/foxpro.rb', line 102 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 |