class Record

Constants

Types

Public Class Methods

build_class( class_name, **attributes ) click to toggle source
# File lib/records/record.rb, line 119
def self.build_class( class_name, **attributes )
  klass = Class.new( Base )
  attributes.each do |key, type|
     klass.field( key, type )
  end

  Type.const_set( class_name, klass )   ## returns klass (plus sets global constant class name)
end
Also aliased as: new
new( class_name, **attributes )
Also aliased as: old_new
Alias for: build_class
old_new( class_name, **attributes )
Alias for: new