Class: ActiveForce::Association::RelationModelBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/active_force/association/relation_model_builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(association, value) ⇒ RelationModelBuilder

Returns a new instance of RelationModelBuilder.



10
11
12
13
# File 'lib/active_force/association/relation_model_builder.rb', line 10

def initialize(association, value)
  @association = association
  @value = value
end

Class Method Details

.build(association, value) ⇒ Object



5
6
7
# File 'lib/active_force/association/relation_model_builder.rb', line 5

def build(association, value)
  new(association, value).build_relation_model
end

Instance Method Details

#build_relation_modelObject



15
16
17
18
# File 'lib/active_force/association/relation_model_builder.rb', line 15

def build_relation_model
  klass = resolve_class
  klass.new(@association, @value).call
end