Module: SharedHelper
- Defined in:
- lib/awesome_form_attributes/shared_helper.rb
Instance Method Summary collapse
- #collections ⇒ Object
- #collections=(objs) ⇒ Object
- #klass ⇒ Object
- #obj_str ⇒ Object
- #single_obj ⇒ Object
- #single_obj=(obj) ⇒ Object
Instance Method Details
#collections ⇒ Object
15 16 17 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 15 def collections instance_variable_get("@#{controller_name}") end |
#collections=(objs) ⇒ Object
23 24 25 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 23 def collections=(objs) instance_variable_set("@#{controller_name}", objs) end |
#klass ⇒ Object
3 4 5 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 3 def klass controller_name.classify.constantize end |
#obj_str ⇒ Object
7 8 9 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 7 def obj_str controller_name.singularize end |
#single_obj ⇒ Object
11 12 13 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 11 def single_obj instance_variable_get("@#{obj_str}") end |
#single_obj=(obj) ⇒ Object
19 20 21 |
# File 'lib/awesome_form_attributes/shared_helper.rb', line 19 def single_obj=(obj) instance_variable_set("@#{obj_str}", obj) end |