Class: Doodle::DataTypeHolder
- Inherits:
-
Object
- Object
- Doodle::DataTypeHolder
- Defined in:
- lib/doodle.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
- #define(name, params, block, type_params, &type_block) ⇒ Object
-
#initialize(klass, &block) ⇒ DataTypeHolder
constructor
A new instance of DataTypeHolder.
Constructor Details
#initialize(klass, &block) ⇒ DataTypeHolder
Returns a new instance of DataTypeHolder.
437 438 439 440 |
# File 'lib/doodle.rb', line 437 def initialize(klass, &block) @klass = klass instance_eval(&block) if block_given? end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
436 437 438 |
# File 'lib/doodle.rb', line 436 def klass @klass end |
Instance Method Details
#define(name, params, block, type_params, &type_block) ⇒ Object
441 442 443 444 445 446 447 |
# File 'lib/doodle.rb', line 441 def define(name, params, block, type_params, &type_block) @klass.class_eval { td = has(name, type_params.merge(params), &type_block) td.instance_eval(&block) if block td } end |