Class: StoplightAdmin::Actions::LockAllGreen

Inherits:
Action
  • Object
show all
Defined in:
lib/stoplight_admin/actions/lock_all_green.rb

Overview

This action locks all lights green

Instance Method Summary collapse

Methods inherited from Action

#initialize

Constructor Details

This class inherits a constructor from StoplightAdmin::Actions::Action

Instance Method Details

#callvoid

This method returns an undefined value.



8
9
10
11
12
13
# File 'lib/stoplight_admin/actions/lock_all_green.rb', line 8

def call(*)
  lights_repository
    .with_color(RED, YELLOW)
    .map(&:name)
    .each { |name| lights_repository.lock(name, GREEN) }
end