Module: Effective::Resources::Model

Included in:
Effective::Resource
Defined in:
app/models/effective/resources/model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#modelObject

As defined by effective_resource do block in a model file



4
5
6
# File 'app/models/effective/resources/model.rb', line 4

def model
  @model
end

Instance Method Details

#_initialize_model(&block) ⇒ Object



6
7
8
9
10
11
12
# File 'app/models/effective/resources/model.rb', line 6

def _initialize_model(&block)
  @model = (model || ModelReader.new)
  @model.read(&block)

  # If effective_developer is in live mode, this will cause it to refresh the class
  ActiveSupport.run_load_hooks(:effective_resource, self)
end