Class: DependencyGrapher::Dependency

Inherits:
Object
  • Object
show all
Includes:
SerializeHelpers
Defined in:
lib/dependency_grapher/dependency.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kaller, receiver) ⇒ Dependency

Returns a new instance of Dependency.



11
12
13
14
15
16
# File 'lib/dependency_grapher/dependency.rb', line 11

def initialize(kaller, receiver)
  @kaller = kaller
  @receiver = receiver
  @flags = Set.new
  @count = 1
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



7
8
9
# File 'lib/dependency_grapher/dependency.rb', line 7

def count
  @count
end

#flagsObject

TODO Fix LOD violation (flag should not be directly exposed)



9
10
11
# File 'lib/dependency_grapher/dependency.rb', line 9

def flags
  @flags
end

#kallerObject (readonly)

Returns the value of attribute kaller.



7
8
9
# File 'lib/dependency_grapher/dependency.rb', line 7

def kaller
  @kaller
end

#receiverObject (readonly)

Returns the value of attribute receiver.



7
8
9
# File 'lib/dependency_grapher/dependency.rb', line 7

def receiver
  @receiver
end

Instance Method Details

#idObject



18
19
20
# File 'lib/dependency_grapher/dependency.rb', line 18

def id
  @kaller.id + @receiver.id
end

#touchObject



22
23
24
# File 'lib/dependency_grapher/dependency.rb', line 22

def touch
  @count += 1
end