Class: LightrateClient::ConsumeLocalBucketTokenResponse
- Inherits:
-
Object
- Object
- LightrateClient::ConsumeLocalBucketTokenResponse
- Defined in:
- lib/lightrate_client/types.rb
Instance Attribute Summary collapse
-
#bucket_status ⇒ Object
readonly
Returns the value of attribute bucket_status.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#used_local_token ⇒ Object
readonly
Returns the value of attribute used_local_token.
Instance Method Summary collapse
-
#initialize(success:, used_local_token: false, bucket_status: nil) ⇒ ConsumeLocalBucketTokenResponse
constructor
A new instance of ConsumeLocalBucketTokenResponse.
-
#required_fetch? ⇒ Boolean
Indicates if this request required fetching tokens from the server.
-
#was_bucket_empty? ⇒ Boolean
Indicates if there were no more tokens available locally before this request.
Constructor Details
#initialize(success:, used_local_token: false, bucket_status: nil) ⇒ ConsumeLocalBucketTokenResponse
Returns a new instance of ConsumeLocalBucketTokenResponse.
74 75 76 77 78 |
# File 'lib/lightrate_client/types.rb', line 74 def initialize(success:, used_local_token: false, bucket_status: nil) @success = success @used_local_token = used_local_token @bucket_status = bucket_status end |
Instance Attribute Details
#bucket_status ⇒ Object (readonly)
Returns the value of attribute bucket_status.
72 73 74 |
# File 'lib/lightrate_client/types.rb', line 72 def bucket_status @bucket_status end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
72 73 74 |
# File 'lib/lightrate_client/types.rb', line 72 def success @success end |
#used_local_token ⇒ Object (readonly)
Returns the value of attribute used_local_token.
72 73 74 |
# File 'lib/lightrate_client/types.rb', line 72 def used_local_token @used_local_token end |
Instance Method Details
#required_fetch? ⇒ Boolean
Indicates if this request required fetching tokens from the server
81 82 83 |
# File 'lib/lightrate_client/types.rb', line 81 def required_fetch? !@used_local_token end |
#was_bucket_empty? ⇒ Boolean
Indicates if there were no more tokens available locally before this request
86 87 88 |
# File 'lib/lightrate_client/types.rb', line 86 def was_bucket_empty? !@used_local_token end |