Class: RateLimit::LimitDefinition
- Inherits:
-
Object
- Object
- RateLimit::LimitDefinition
- Defined in:
- lib/ratelimit/limit_definition.rb
Instance Attribute Summary collapse
-
#burst ⇒ Object
readonly
Returns the value of attribute burst.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#returnable ⇒ Object
readonly
Returns the value of attribute returnable.
Instance Method Summary collapse
-
#initialize(group, limit, policy, returnable, burst) ⇒ LimitDefinition
constructor
A new instance of LimitDefinition.
Constructor Details
#initialize(group, limit, policy, returnable, burst) ⇒ LimitDefinition
Returns a new instance of LimitDefinition.
16 17 18 19 20 21 22 23 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def initialize(group, limit, policy, returnable, burst) raise "Invalid Policy" unless POLICIES.include? policy @limit = limit @group = group @policy = policy @returnable = returnable @burst = burst end |
Instance Attribute Details
#burst ⇒ Object (readonly)
Returns the value of attribute burst.
14 15 16 |
# File 'lib/ratelimit/limit_definition.rb', line 14 def burst @burst end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
14 15 16 |
# File 'lib/ratelimit/limit_definition.rb', line 14 def group @group end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
14 15 16 |
# File 'lib/ratelimit/limit_definition.rb', line 14 def limit @limit end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
14 15 16 |
# File 'lib/ratelimit/limit_definition.rb', line 14 def policy @policy end |
#returnable ⇒ Object (readonly)
Returns the value of attribute returnable.
14 15 16 |
# File 'lib/ratelimit/limit_definition.rb', line 14 def returnable @returnable end |