Class: SlimFormObject::Assign
- Inherits:
-
Object
- Object
- SlimFormObject::Assign
- Includes:
- HelperMethods
- Defined in:
- lib/slim_form_object/assign.rb
Instance Attribute Summary collapse
-
#all_updated_objects ⇒ Object
readonly
Returns the value of attribute all_updated_objects.
-
#base_module ⇒ Object
readonly
Returns the value of attribute base_module.
-
#form_object ⇒ Object
readonly
Returns the value of attribute form_object.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#validator ⇒ Object
readonly
Returns the value of attribute validator.
Instance Method Summary collapse
- #apply_parameters ⇒ Object
- #associate_objects ⇒ Object
-
#initialize(form_object) ⇒ Assign
constructor
A new instance of Assign.
Methods included from HelperMethods
#apply_expression_text, #get_association, #get_class_of_snake_model_name, #get_self_object, #snake, #to_bind_models
Constructor Details
#initialize(form_object) ⇒ Assign
Returns a new instance of Assign.
7 8 9 10 11 12 13 14 |
# File 'lib/slim_form_object/assign.rb', line 7 def initialize(form_object) @form_object = form_object @base_module = form_object.class.base_module @params = form_object.params @array_all_objects_for_save = form_object.array_all_objects_for_save @validator = Validator.new(form_object) @all_updated_objects = [] end |
Instance Attribute Details
#all_updated_objects ⇒ Object (readonly)
Returns the value of attribute all_updated_objects.
5 6 7 |
# File 'lib/slim_form_object/assign.rb', line 5 def all_updated_objects @all_updated_objects end |
#base_module ⇒ Object (readonly)
Returns the value of attribute base_module.
5 6 7 |
# File 'lib/slim_form_object/assign.rb', line 5 def base_module @base_module end |
#form_object ⇒ Object (readonly)
Returns the value of attribute form_object.
5 6 7 |
# File 'lib/slim_form_object/assign.rb', line 5 def form_object @form_object end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/slim_form_object/assign.rb', line 5 def params @params end |
#validator ⇒ Object (readonly)
Returns the value of attribute validator.
5 6 7 |
# File 'lib/slim_form_object/assign.rb', line 5 def validator @validator end |
Instance Method Details
#apply_parameters ⇒ Object
16 17 18 19 20 21 |
# File 'lib/slim_form_object/assign.rb', line 16 def apply_parameters make_all_objects_with_attributes clear_nil_objects all_updated_objects end |
#associate_objects ⇒ Object
23 24 25 26 27 |
# File 'lib/slim_form_object/assign.rb', line 23 def associate_objects associate_all_objects(all_updated_objects) all_updated_objects end |