Class: Smtp2go::RateLimit

Inherits:
Object
  • Object
show all
Defined in:
lib/smtp2go/core.rb

Overview

Rate limiting class to be attached to response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers) ⇒ RateLimit

Returns a new instance of RateLimit.



75
76
77
78
79
# File 'lib/smtp2go/core.rb', line 75

def initialize(headers)
  @limit = headers['x-ratelimit-limit']
  @remaining = headers['x-ratelimit-remaining']
  @reset = headers['x-ratelimit-reset']
end

Instance Attribute Details

#limitObject (readonly)

Returns the value of attribute limit.



74
75
76
# File 'lib/smtp2go/core.rb', line 74

def limit
  @limit
end

#remainingObject (readonly)

Returns the value of attribute remaining.



74
75
76
# File 'lib/smtp2go/core.rb', line 74

def remaining
  @remaining
end

#resetObject (readonly)

Returns the value of attribute reset.



74
75
76
# File 'lib/smtp2go/core.rb', line 74

def reset
  @reset
end