Class: Lustr::GadgetBuilder

Inherits:
BuilderBase show all
Defined in:
lib/lustr/gadget.rb

Instance Attribute Summary collapse

Attributes inherited from BuilderBase

#children, #event_handlers, #name, #options, #widget_type

Instance Method Summary collapse

Methods inherited from BuilderBase

#<<, #all_event_handlers

Constructor Details

#initialize(options = {}) ⇒ GadgetBuilder

Returns a new instance of GadgetBuilder.



78
79
80
81
# File 'lib/lustr/gadget.rb', line 78

def initialize(options={})
	super(nil, options)
	@controller=options[:controller]
end

Instance Attribute Details

#controllerObject

Returns the value of attribute controller.



76
77
78
# File 'lib/lustr/gadget.rb', line 76

def controller
  @controller
end

Instance Method Details

#build(parent_widget) ⇒ Object



98
99
100
# File 'lib/lustr/gadget.rb', line 98

def build(parent_widget)
	return Gadget.new(self, parent_widget, controller, options)
end

#build_all(eval_context, parent_widget = nil) ⇒ Object



91
92
93
94
95
96
# File 'lib/lustr/gadget.rb', line 91

def build_all(eval_context, parent_widget=nil)
	gadget=super
	eval_context.init_gadget gadget, self
	
	return gadget
end

#dup_from(options) ⇒ Object



83
84
85
86
87
88
89
# File 'lib/lustr/gadget.rb', line 83

def dup_from(options)
	myself=self.dup
	myself.options=options
	myself.controller=controller

	return myself
end