Class: Stoplight::Admin::Dependencies

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_store:) ⇒ Dependencies

Returns a new instance of Dependencies.

Parameters:

  • data_store (Stoplight::Domain::_DataStore)


12
13
14
# File 'lib/stoplight/admin/dependencies.rb', line 12

def initialize(data_store:)
  @data_store = data_store
end

Instance Attribute Details

#data_store=(value) ⇒ Stoplight::DataStore::Base



8
9
10
# File 'lib/stoplight/admin/dependencies.rb', line 8

def data_store
  @data_store
end

Instance Method Details

#green_actionStoplight::Admin::Actions::LockGreen



35
36
37
# File 'lib/stoplight/admin/dependencies.rb', line 35

def green_action
  Stoplight::Admin::Actions::LockGreen.new(lights_repository: lights_repository)
end

#green_all_actionStoplight::Admin::Actions::LockAllGreen



45
46
47
# File 'lib/stoplight/admin/dependencies.rb', line 45

def green_all_action
  Stoplight::Admin::Actions::LockAllGreen.new(lights_repository: lights_repository)
end

#lights_repositoryStoplight::Admin::LightsRepository



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

def lights_repository
  Stoplight::Admin::LightsRepository.new(data_store: data_store)
end

#red_actionStoplight::Admin::Actions::LockRed



40
41
42
# File 'lib/stoplight/admin/dependencies.rb', line 40

def red_action
  Stoplight::Admin::Actions::LockRed.new(lights_repository: lights_repository)
end

#remove_actionStoplight::Admin::Actions::Remove



50
51
52
# File 'lib/stoplight/admin/dependencies.rb', line 50

def remove_action
  Stoplight::Admin::Actions::Remove.new(lights_repository: lights_repository)
end

#stats_actionStoplight::Admin::Actions::Stats



22
23
24
25
26
27
# File 'lib/stoplight/admin/dependencies.rb', line 22

def stats_action
  Stoplight::Admin::Actions::Stats.new(
    lights_repository: lights_repository,
    lights_stats: Stoplight::Admin::LightsStats
  )
end

#unlock_actionStoplight::Admin::Actions::Unlock



30
31
32
# File 'lib/stoplight/admin/dependencies.rb', line 30

def unlock_action
  Stoplight::Admin::Actions::Unlock.new(lights_repository: lights_repository)
end