Class: Cheri::Builder::Generator::TypeBuilder

Inherits:
Object
  • Object
show all
Includes:
Builder
Defined in:
lib/cheri/builder/generator.rb

Overview

Template

Instance Method Summary collapse

Methods included from Builder

#args, #sym

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

Returns:

  • (Boolean)


75
76
77
# File 'lib/cheri/builder/generator.rb', line 75

def any?
  @type.any?
end

#child?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/cheri/builder/generator.rb', line 72

def child?
  @type.child?
end

#modObject

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

Returns:

  • (Boolean)


69
70
71
# File 'lib/cheri/builder/generator.rb', line 69

def parent?
  @type.parent?    
end

#runObject



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