Class: Cheri::Builder::Generator::TypeBuilder
- Inherits:
-
Object
- Object
- Cheri::Builder::Generator::TypeBuilder
- Includes:
- Builder
- Defined in:
- lib/cheri/builder/generator.rb
Overview
Template
Instance Method Summary collapse
- #any? ⇒ Boolean
- #child? ⇒ Boolean
-
#initialize(mod, type, *r, &k) ⇒ TypeBuilder
constructor
A new instance of TypeBuilder.
-
#mod ⇒ Object
returns the module to which this builder belongs.
- #parent? ⇒ Boolean
- #run ⇒ Object
Methods included from Builder
Methods included from Frame
#block, #ctx, #inspect, #object
Constructor Details
#initialize(mod, type, *r, &k) ⇒ TypeBuilder
Returns a new instance of TypeBuilder.
54 55 56 57 58 59 |
# File 'lib/cheri/builder/generator.rb', line 54 def initialize(mod,type,*r,&k) super(*r,&k) @mod = mod @type = type @clazz = type.clazz end |
Instance Method Details
#any? ⇒ Boolean
75 76 77 |
# File 'lib/cheri/builder/generator.rb', line 75 def any? @type.any? end |
#child? ⇒ Boolean
72 73 74 |
# File 'lib/cheri/builder/generator.rb', line 72 def child? @type.child? end |
#mod ⇒ Object
returns the module to which this builder belongs
61 62 63 |
# File 'lib/cheri/builder/generator.rb', line 61 def mod @mod end |
#parent? ⇒ Boolean
69 70 71 |
# File 'lib/cheri/builder/generator.rb', line 69 def parent? @type.parent? end |
#run ⇒ Object
64 65 66 67 68 |
# File 'lib/cheri/builder/generator.rb', line 64 def run @obj = @clazz.new(*@args) @ctx.call(self,&@blk) if @blk @obj end |