Sha256: 3fd9968ec88733aff9cd64eb70a48461f5a18d561364c4af8fdfcebb4b0512f2

Contents?: true

Size: 374 Bytes

Versions: 14

Compression:

Stored size: 374 Bytes

Contents

# All models have a state that has to do with it being loaded, in process of
# being loaded, or not yet loading.
module ModelState

  def state
    if @persistor && @persistor.respond_to?(:state)
      @persistor.state
    else
      @state || :loaded
    end
  end

  def change_state_to(state)
    @state = state
  end

  def loaded?
    self.state == :loaded
  end


end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
volt-0.8.14 lib/volt/models/model_state.rb
volt-0.8.13 lib/volt/models/model_state.rb
volt-0.8.11 lib/volt/models/model_state.rb
volt-0.8.10 lib/volt/models/model_state.rb
volt-0.8.9 lib/volt/models/model_state.rb
volt-0.8.8 lib/volt/models/model_state.rb
volt-0.8.7 lib/volt/models/model_state.rb
volt-0.8.6 lib/volt/models/model_state.rb
volt-0.8.5 lib/volt/models/model_state.rb
volt-0.8.4 lib/volt/models/model_state.rb
volt-0.8.3 lib/volt/models/model_state.rb
volt-0.8.2 lib/volt/models/model_state.rb
volt-0.8.1 lib/volt/models/model_state.rb
volt-0.8.0 lib/volt/models/model_state.rb