Method: Model#initialize

Defined in:
lib/volt/models/model.rb

#initialize(attributes = {}, options = {}, initial_state = nil) ⇒ Model

Returns a new instance of Model.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/volt/models/model.rb', line 32

def initialize(attributes={}, options={}, initial_state=nil)
  self.options = options

  self.send(:attributes=, attributes, true)

  @cache = {}

  # Models stat in a loaded state since they are normally setup from an
  # ArrayModel, which will have the data when they get added.
  @state = :loaded

  @persistor.loaded(initial_state) if @persistor
end