Class: Formic::Button
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Attributes inherited from Base
#content, #options, #page, #template
Instance Method Summary collapse
- #_initialize(label = nil, options = {}, &block) ⇒ Object
- #method_missing(method, label = nil, options = {}, &block) ⇒ Object
Methods inherited from Base
#add_class, default_template, #formics, #has_class?, #initialize, #merge_options, template, #to_s
Constructor Details
This class inherits a constructor from Formic::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, label = nil, options = {}, &block) ⇒ Object
16 17 18 19 20 |
# File 'lib/formic/button.rb', line 16 def method_missing method, label=nil, ={}, &block super method, label, {}, &block @label ||= method.to_s.underscore.titleize return self end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
5 6 7 |
# File 'lib/formic/button.rb', line 5 def label @label end |
Instance Method Details
#_initialize(label = nil, options = {}, &block) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/formic/button.rb', line 6 def _initialize label=nil, ={}, &block if label.instance_of? Hash = label label = nil end super , &block @label = label end |