Class: LightrateClient::Rule
- Inherits:
-
Object
- Object
- LightrateClient::Rule
- Defined in:
- lib/lightrate_client/types.rb
Instance Attribute Summary collapse
-
#burst_rate ⇒ Object
readonly
Returns the value of attribute burst_rate.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#is_default ⇒ Object
readonly
Returns the value of attribute is_default.
-
#matcher ⇒ Object
readonly
Returns the value of attribute matcher.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#refill_rate ⇒ Object
readonly
Returns the value of attribute refill_rate.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id:, name:, refill_rate:, burst_rate:, is_default: false, matcher: nil, http_method: nil) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(id:, name:, refill_rate:, burst_rate:, is_default: false, matcher: nil, http_method: nil) ⇒ Rule
Returns a new instance of Rule.
94 95 96 97 98 99 100 101 102 |
# File 'lib/lightrate_client/types.rb', line 94 def initialize(id:, name:, refill_rate:, burst_rate:, is_default: false, matcher: nil, http_method: nil) @id = id @name = name @refill_rate = refill_rate @burst_rate = burst_rate @is_default = is_default @matcher = matcher @http_method = http_method end |
Instance Attribute Details
#burst_rate ⇒ Object (readonly)
Returns the value of attribute burst_rate.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def burst_rate @burst_rate end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def http_method @http_method end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def id @id end |
#is_default ⇒ Object (readonly)
Returns the value of attribute is_default.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def is_default @is_default end |
#matcher ⇒ Object (readonly)
Returns the value of attribute matcher.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def matcher @matcher end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def name @name end |
#refill_rate ⇒ Object (readonly)
Returns the value of attribute refill_rate.
92 93 94 |
# File 'lib/lightrate_client/types.rb', line 92 def refill_rate @refill_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/lightrate_client/types.rb', line 104 def self.from_hash(hash) new( id: hash['id'] || hash[:id], name: hash['name'] || hash[:name], refill_rate: hash['refillRate'] || hash[:refill_rate], burst_rate: hash['burstRate'] || hash[:burst_rate], is_default: hash['isDefault'] || hash[:is_default] || false, matcher: hash['matcher'] || hash[:matcher], http_method: hash['httpMethod'] || hash[:http_method] ) end |