Class: Mack::ViewHelpers::FormHelpers::FormElement
- Defined in:
- lib/mack/view_helpers/form_helpers.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#calling_method ⇒ Object
Returns the value of attribute calling_method.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(*args) ⇒ FormElement
constructor
A new instance of FormElement.
Constructor Details
#initialize(*args) ⇒ FormElement
Returns a new instance of FormElement.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/mack/view_helpers/form_helpers.rb', line 312 def initialize(*args) args = args.parse_splat_args self.calling_method = :to_s self. = {} case args when Symbol, String self.calling_method = args when Hash self. = args when Array self.calling_method = args[0] self. = args[1] when nil else raise ArgumentError.new("You must provide either a Symbol, a String, a Hash, or a combination thereof.") end if self.[:checked] self.[:checked] = :checked end end |
Instance Attribute Details
#calling_method ⇒ Object
Returns the value of attribute calling_method.
309 310 311 |
# File 'lib/mack/view_helpers/form_helpers.rb', line 309 def calling_method @calling_method end |
#options ⇒ Object
Returns the value of attribute options.
310 311 312 |
# File 'lib/mack/view_helpers/form_helpers.rb', line 310 def @options end |