Class: Pause::PeriodCheck

Inherits:
Struct
  • Object
show all
Defined in:
lib/pause.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, period_seconds: nil, max_allowed: nil, block_ttl: nil) ⇒ PeriodCheck

Returns a new instance of PeriodCheck.



16
17
18
19
20
21
22
# File 'lib/pause.rb', line 16

def initialize(*args, period_seconds: nil, max_allowed: nil, block_ttl: nil)
  if args.any?
    super(*args)
  else
    super(period_seconds, max_allowed, block_ttl)
  end
end

Instance Attribute Details

#block_ttlObject

Returns the value of attribute block_ttl

Returns:

  • (Object)

    the current value of block_ttl



15
16
17
# File 'lib/pause.rb', line 15

def block_ttl
  @block_ttl
end

#max_allowedObject

Returns the value of attribute max_allowed

Returns:

  • (Object)

    the current value of max_allowed



15
16
17
# File 'lib/pause.rb', line 15

def max_allowed
  @max_allowed
end

#period_secondsObject

Returns the value of attribute period_seconds

Returns:

  • (Object)

    the current value of period_seconds



15
16
17
# File 'lib/pause.rb', line 15

def period_seconds
  @period_seconds
end

Instance Method Details

#<=>(other) ⇒ Object



24
25
26
# File 'lib/pause.rb', line 24

def <=>(other)
  period_seconds <=> other.period_seconds
end