Class: Colonization::ModelRelation
- Inherits:
-
ModelEntity
- Object
- ModelEntity
- Colonization::ModelRelation
- Defined in:
- lib/colonization/model_relation.rb
Constant Summary collapse
- DEAFULT_SEED_INDEX =
3
Instance Method Summary collapse
-
#initialize(reflection, strategy) ⇒ ModelRelation
constructor
A new instance of ModelRelation.
- #name ⇒ Object
- #reflection ⇒ Object
- #strategy ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(reflection, strategy) ⇒ ModelRelation
9 10 11 12 |
# File 'lib/colonization/model_relation.rb', line 9 def initialize(reflection, strategy) @reflection = reflection @strategy = strategy end |
Instance Method Details
#name ⇒ Object
22 23 24 |
# File 'lib/colonization/model_relation.rb', line 22 def name reflection.name end |
#reflection ⇒ Object
14 15 16 |
# File 'lib/colonization/model_relation.rb', line 14 def reflection @reflection end |
#strategy ⇒ Object
18 19 20 |
# File 'lib/colonization/model_relation.rb', line 18 def strategy @strategy || {} end |
#value ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/colonization/model_relation.rb', line 26 def value if strategy[:type] == :fixed generate_relation_value_with_fixed_strategy else generate_relation_value_with_default_strategy end end |