Module: Volt::ModelState
- Included in:
- ArrayModel, Model
- Defined in:
- lib/volt/models/model_state.rb
Overview
All models have a state that has to do with it being loaded, in process of being loaded, or not yet loading.
Instance Method Summary collapse
Instance Method Details
#change_state_to(state) ⇒ Object
13 14 15 |
# File 'lib/volt/models/model_state.rb', line 13 def change_state_to(state) @state = state end |
#loaded? ⇒ Boolean
17 18 19 |
# File 'lib/volt/models/model_state.rb', line 17 def loaded? state == :loaded end |
#state ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/volt/models/model_state.rb', line 5 def state if @persistor && @persistor.respond_to?(:state) @persistor.state else @state || :loaded end end |