Class: Lapillus::ListItem
- Defined in:
- lib/lapillus/components.rb,
lib/lapillus/components.rb,
lib/lapillus/containers.rb,
lib/lapillus/containers.rb
Overview
TODO: Add test!
Instance Attribute Summary
Attributes inherited from Container
Attributes inherited from Component
#behaviours, #identifier, #model, #property, #visible
Instance Method Summary collapse
- #image(id, options = {}) ⇒ Object
- #label(id, options = {}) ⇒ Object
- #method_missing(method) ⇒ Object
- #panel(id, clazz, model = nil, options = {}) ⇒ Object
Methods inherited from Container
#[], #add, add_component, #component, fileuploadfield, image, #initialize, label, listview, panel, password_textfield, #post, #render_container, textarea, textfield
Methods inherited from Component
#add_behaviour, #behaviour, #has_behaviour?, #has_model?, #has_parent?, #initialize, #on_render, #parent, #path, #render_component, #response_page=, #session, #value, #visible?, #webpage
Constructor Details
This class inherits a constructor from Lapillus::Container
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method) ⇒ Object
103 104 105 |
# File 'lib/lapillus/containers.rb', line 103 def method_missing(method) component(method.to_s) end |
Instance Method Details
#image(id, options = {}) ⇒ Object
108 109 110 111 112 113 |
# File 'lib/lapillus/components.rb', line 108 def image(id, ={}) .keys.each {|key| raise "Unknown key: #{key}" if key!=:model and key!=:root_url } add(Image.new(id, [:model], [:root_url])) end |
#label(id, options = {}) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/lapillus/components.rb', line 31 def label(id, ={}) .keys.each {|key| raise "Unknown key: #{key}" if key!=:model and key!=:property } add(Label.new(id, [:model], [:property])) end |
#panel(id, clazz, model = nil, options = {}) ⇒ Object
196 197 198 |
# File 'lib/lapillus/containers.rb', line 196 def panel(id, clazz, model=nil, ={}) add(clazz.new(id, model)) end |