Class: Record
- Inherits:
-
Object
- Object
- Record
- Defined in:
- lib/records/record.rb
Direct Known Subclasses
Defined Under Namespace
Constant Summary collapse
- Types =
note Types is an alias for Type
Type
Class Method Summary collapse
- .build_class(class_name, **attributes) ⇒ Object (also: new)
Class Method Details
.build_class(class_name, **attributes) ⇒ Object Also known as: new
119 120 121 122 123 124 125 126 |
# 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 |