Class: Moon::Action::Models::Initializer::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/moon/action/models/initializer.rb

Overview

Build a model out of the key and the hash

Instance Method Summary collapse

Constructor Details

#initialize(key, attributes) ⇒ Builder

Returns a new instance of Builder.



23
24
25
# File 'lib/moon/action/models/initializer.rb', line 23

def initialize(key, attributes)
  @key, @attributes = key, attributes
end

Instance Method Details

#modelObject



27
28
29
30
31
32
# File 'lib/moon/action/models/initializer.rb', line 27

def model
  fetch_model_class
  initialize_model
  set_model_attributes
  @model
end