Class: Kameleon::DSL::Act::SelectTag
- Inherits:
-
Object
- Object
- Kameleon::DSL::Act::SelectTag
- Defined in:
- lib/kameleon/dsl/act/form.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
Instance Method Summary collapse
-
#initialize(action, params) ⇒ SelectTag
constructor
A new instance of SelectTag.
- #parse_params(params) ⇒ Object
Constructor Details
#initialize(action, params) ⇒ SelectTag
Returns a new instance of SelectTag.
49 50 51 52 53 54 |
# File 'lib/kameleon/dsl/act/form.rb', line 49 def initialize(action, params) raise "not implemented" unless params.kind_of?(Hash) @action = action @actions = [] parse_params(params) end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
47 48 49 |
# File 'lib/kameleon/dsl/act/form.rb', line 47 def action @action end |
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
47 48 49 |
# File 'lib/kameleon/dsl/act/form.rb', line 47 def actions @actions end |
Instance Method Details
#parse_params(params) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/kameleon/dsl/act/form.rb', line 56 def parse_params(params) params.each_pair do |option, id| case id when Symbol parse_params(option => id.to_s) when String if option.kind_of?(Array) option.each do |o| parse_params(o => id) end else actions << Action.new(action, option.to_s, :from => id) end end end end |