Methods

RBase

Public Class Methods

create_table(name, options = {}) click to toggle source

Create new XBase table file. Table file name will be equal to name with ".dbf" suffix.

For list of available options see Table::create documentation.

Example

RBase.create_table 'people' do |t|
  t.column :name, :string, :size => 30
  t.column :birthdate, :date
  t.column :active, :boolean
  t.column :tax, :integer, :size => 10, :decimal => 2
end

For documentation on column parameters see RBase::Schema.column documentation.

# File lib/rbase/builder.rb, line 22
def self.create_table(name, options = {})
  options[:language] ||= LANGUAGE_RUSSIAN_WINDOWS
  
  schema = Schema.new
  yield schema if block_given?
  
  Table.create name, schema, options
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.