Class: Dependencies

Inherits:
Object
  • Object
show all
Defined in:
lib/gimuby/dependencies.rb

Overview

Dependencies container that is accessed from everywhere in the app

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDependencies

Returns a new instance of Dependencies.



9
10
11
12
13
14
15
# File 'lib/gimuby/dependencies.rb', line 9

def initialize
  @event_manager = EventManager.new

  # problem specific
  @tsp = nil
  @foxholes = nil
end

Instance Attribute Details

#event_managerObject

Returns the value of attribute event_manager.



17
18
19
# File 'lib/gimuby/dependencies.rb', line 17

def event_manager
  @event_manager
end

Instance Method Details

#foxholesObject



28
29
30
31
32
33
# File 'lib/gimuby/dependencies.rb', line 28

def foxholes
  if @foxholes.nil?
    @foxholes = Foxholes.new
  end
  @foxholes
end

#tspObject

problem specific



21
22
23
24
25
26
# File 'lib/gimuby/dependencies.rb', line 21

def tsp
  if @tsp.nil?
    @tsp = Tsp.new
  end
  @tsp
end