Exception: Stoplight::Error::RedLight

Inherits:
Base
  • Object
show all
Defined in:
lib/stoplight/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(light_name, cool_off_time:, retry_after:) ⇒ Stoplight::Error::RedLight

Initializes a new RedLight error.

Parameters:

  • light_name (String)

    The light’s name

  • cool_off_time (Hash)

    a customizable set of options

  • retry_after (Hash)

    a customizable set of options

Options Hash (cool_off_time:):

  • Cool-off (Numeric)

    period in seconds

Options Hash (retry_after:):

  • Absolute (Time | nil)

    Time after which a recovery attempt can occur



40
41
42
43
44
45
46
# File 'lib/stoplight/error.rb', line 40

def initialize(light_name, cool_off_time:, retry_after:)
  @light_name = light_name
  @cool_off_time = cool_off_time
  @retry_after = retry_after

  super(light_name)
end

Instance Attribute Details

#cool_off_timeObject

Returns the value of attribute cool_off_time.



23
24
25
# File 'lib/stoplight/error.rb', line 23

def cool_off_time
  @cool_off_time
end

#light_nameObject

Returns the value of attribute light_name.



18
19
20
# File 'lib/stoplight/error.rb', line 18

def light_name
  @light_name
end

#retry_afterObject

Returns the value of attribute retry_after.



29
30
31
# File 'lib/stoplight/error.rb', line 29

def retry_after
  @retry_after
end