Class: Smtp2go::RateLimit
- Inherits:
-
Object
- Object
- Smtp2go::RateLimit
- Defined in:
- lib/smtp2go/core.rb
Overview
Rate limiting class to be attached to response
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#remaining ⇒ Object
readonly
Returns the value of attribute remaining.
-
#reset ⇒ Object
readonly
Returns the value of attribute reset.
Instance Method Summary collapse
-
#initialize(headers) ⇒ RateLimit
constructor
A new instance of RateLimit.
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
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
74 75 76 |
# File 'lib/smtp2go/core.rb', line 74 def limit @limit end |
#remaining ⇒ Object (readonly)
Returns the value of attribute remaining.
74 75 76 |
# File 'lib/smtp2go/core.rb', line 74 def remaining @remaining end |
#reset ⇒ Object (readonly)
Returns the value of attribute reset.
74 75 76 |
# File 'lib/smtp2go/core.rb', line 74 def reset @reset end |