Class: Analyst::EntityParser::ClassRelation
- Inherits:
-
Object
- Object
- Analyst::EntityParser::ClassRelation
- Defined in:
- lib/analyst/association.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#target_class_name ⇒ Object
readonly
Returns the value of attribute target_class_name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type:, source:, target_class_name:) ⇒ ClassRelation
constructor
A new instance of ClassRelation.
- #resolve_target!(entity_list) ⇒ Object
Constructor Details
#initialize(type:, source:, target_class_name:) ⇒ ClassRelation
Returns a new instance of ClassRelation.
8 9 10 11 12 |
# File 'lib/analyst/association.rb', line 8 def initialize(type:, source:, target_class_name:) @type = type @source = source @target_class_name = target_class_name end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
6 7 8 |
# File 'lib/analyst/association.rb', line 6 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
6 7 8 |
# File 'lib/analyst/association.rb', line 6 def target @target end |
#target_class_name ⇒ Object (readonly)
Returns the value of attribute target_class_name.
6 7 8 |
# File 'lib/analyst/association.rb', line 6 def target_class_name @target_class_name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
6 7 8 |
# File 'lib/analyst/association.rb', line 6 def type @type end |
Instance Method Details
#resolve_target!(entity_list) ⇒ Object
14 15 16 17 18 |
# File 'lib/analyst/association.rb', line 14 def resolve_target!(entity_list) unless @target = entity_list.detect{ |entity| entity.full_name == self.target_class_name } puts "WARNING: Couldn't find target: #{self.target_class_name}" end end |