Class: Colonization::ModelRelation
- Inherits:
-
ModelEntity
- Object
- ModelEntity
- Colonization::ModelRelation
- Defined in:
- lib/colonization/model_relation.rb
Instance Attribute Summary collapse
-
#reflection ⇒ Object
Returns the value of attribute reflection.
-
#strategy ⇒ Object
Returns the value of attribute strategy.
Instance Method Summary collapse
-
#initialize(reflection, strategy) ⇒ ModelRelation
constructor
A new instance of ModelRelation.
- #name ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(reflection, strategy) ⇒ ModelRelation
Returns a new instance of ModelRelation.
9 10 11 12 |
# File 'lib/colonization/model_relation.rb', line 9 def initialize(reflection, strategy) @reflection = reflection @strategy = strategy || {} end |
Instance Attribute Details
#reflection ⇒ Object
Returns the value of attribute reflection.
7 8 9 |
# File 'lib/colonization/model_relation.rb', line 7 def reflection @reflection end |
#strategy ⇒ Object
Returns the value of attribute strategy.
7 8 9 |
# File 'lib/colonization/model_relation.rb', line 7 def strategy @strategy end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/colonization/model_relation.rb', line 14 def name reflection.name end |
#value ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/colonization/model_relation.rb', line 18 def value if strategy == :fixed #TODO: refactor this shit generate_relation_value_with_fixed_strategy else generate_relation_value_with_default_strategy end end |