Class: Lustr::TemplatedWidget
- Inherits:
-
Object
- Object
- Lustr::TemplatedWidget
show all
- Includes:
- WidgetBase
- Defined in:
- lib/lustr/widget.rb
Instance Attribute Summary
Attributes included from WidgetBase
#eval_context, #gadget, #label, #name, #options, #parent
Instance Method Summary
collapse
Methods included from WidgetBase
#<<, #_add, #children, #controller=, #init_options, #option, #raise_event, #resolve, #resolve_parent, #to_s
Instance Method Details
#children_contents(ctxt) ⇒ Object
92
93
94
95
96
97
98
99
100
|
# File 'lib/lustr/widget.rb', line 92
def children_contents(ctxt)
result=''
children.each do |child|
result+=child.contents(ctxt)+"\n" if child.respond_to?(:contents)
end
return(result)
end
|
#contents(ctxt) ⇒ Object
88
89
90
|
# File 'lib/lustr/widget.rb', line 88
def contents(ctxt)
ERB.new(template).result(binding)
end
|
#generate(ctxt) ⇒ Object
84
85
86
|
# File 'lib/lustr/widget.rb', line 84
def generate(ctxt)
ctxt << contents(ctxt)
end
|