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.
-
#safety_level ⇒ Object
Returns the value of attribute safety_level.
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.
19 20 21 22 23 24 25 26 |
# File 'lib/ratelimit/limit_definition.rb', line 19 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.
16 17 18 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def burst @burst end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
16 17 18 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def group @group end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
16 17 18 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def limit @limit end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
16 17 18 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def policy @policy end |
#returnable ⇒ Object (readonly)
Returns the value of attribute returnable.
16 17 18 |
# File 'lib/ratelimit/limit_definition.rb', line 16 def returnable @returnable end |
#safety_level ⇒ Object
Returns the value of attribute safety_level.
17 18 19 |
# File 'lib/ratelimit/limit_definition.rb', line 17 def safety_level @safety_level end |