Class: Analyst::EntityParser::ClassRelation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/analyst/association.rb', line 6

def source
  @source
end

#targetObject (readonly)

Returns the value of attribute target.



6
7
8
# File 'lib/analyst/association.rb', line 6

def target
  @target
end

#target_class_nameObject (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

#typeObject (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