Class: Doodle::DataTypeHolder
- Inherits:
-
Object
- Object
- Doodle::DataTypeHolder
- Defined in:
- lib/doodle.rb
Overview
implements the #doodle directive
Instance Attribute Summary collapse
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
- #arg_order(*args, &block) ⇒ Object
- #define(name, params, block, type_params, &type_block) ⇒ Object
- #doc(*args, &block) ⇒ Object
- #from(*args, &block) ⇒ Object
- #has(*args, &block) ⇒ Object
-
#initialize(klass, &block) ⇒ DataTypeHolder
constructor
A new instance of DataTypeHolder.
- #must(*args, &block) ⇒ Object
Constructor Details
#initialize(klass, &block) ⇒ DataTypeHolder
Returns a new instance of DataTypeHolder.
574 575 576 577 |
# File 'lib/doodle.rb', line 574 def initialize(klass, &block) @klass = klass instance_eval(&block) if block_given? end |
Instance Attribute Details
#klass ⇒ Object
Returns the value of attribute klass.
573 574 575 |
# File 'lib/doodle.rb', line 573 def klass @klass end |
Instance Method Details
#arg_order(*args, &block) ⇒ Object
594 595 596 |
# File 'lib/doodle.rb', line 594 def arg_order(*args, &block) @klass.class_eval { arg_order(*args, &block) } end |
#define(name, params, block, type_params, &type_block) ⇒ Object
578 579 580 581 582 583 584 |
# File 'lib/doodle.rb', line 578 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 |
#doc(*args, &block) ⇒ Object
597 598 599 |
# File 'lib/doodle.rb', line 597 def doc(*args, &block) @klass.class_eval { doc(*args, &block) } end |
#from(*args, &block) ⇒ Object
591 592 593 |
# File 'lib/doodle.rb', line 591 def from(*args, &block) @klass.class_eval { from(*args, &block) } end |
#has(*args, &block) ⇒ Object
585 586 587 |
# File 'lib/doodle.rb', line 585 def has(*args, &block) @klass.class_eval { has(*args, &block) } end |
#must(*args, &block) ⇒ Object
588 589 590 |
# File 'lib/doodle.rb', line 588 def must(*args, &block) @klass.class_eval { must(*args, &block) } end |