Module: IronNails::Core::ViewModelObjectOperations
- Included in:
- ViewModelOperations
- Defined in:
- lib/ironnails/nails_engine.rb
Instance Attribute Summary collapse
-
#model_queue ⇒ Object
gets or sets the models that wil be used in the view to bind to.
Instance Method Summary collapse
-
#add_model_to_queue_on(model) ⇒ Object
(also: #add_models_to_queue_on)
adds a new model to the queue for synchronisation to the view.
- #init_object_operations ⇒ Object
Instance Attribute Details
#model_queue ⇒ Object
gets or sets the models that wil be used in the view to bind to
104 105 106 |
# File 'lib/ironnails/nails_engine.rb', line 104 def model_queue @model_queue end |
Instance Method Details
#add_model_to_queue_on(model) ⇒ Object Also known as: add_models_to_queue_on
adds a new model to the queue for synchronisation to the view
120 121 122 123 124 125 126 127 128 |
# File 'lib/ironnails/nails_engine.rb', line 120 def add_model_to_queue_on(model) if model.respond_to?(:has_model?) model.each do |m| enqueue_model(m) end elsif model.is_a?(Hash) enqueue_model(model) end end |
#init_object_operations ⇒ Object
106 107 108 |
# File 'lib/ironnails/nails_engine.rb', line 106 def init_object_operations @model_queue = ModelCollection.new end |