Class: Hook0::Generated::QuotasResponse
- Inherits:
-
Object
- Object
- Hook0::Generated::QuotasResponse
- Defined in:
- lib/hook0/generated/models.rb
Overview
The QuotasResponse the API declares.
Instance Attribute Summary collapse
-
#enabled ⇒ Object
readonly
Returns the value of attribute enabled.
-
#limits ⇒ Object
readonly
Returns the value of attribute limits.
Class Method Summary collapse
-
.from_json(value) ⇒ QuotasResponse
Read one out of what the API answered.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Whether that value carries the same members as this one.
-
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
-
#initialize(enabled:, limits:) ⇒ QuotasResponse
constructor
A new instance of QuotasResponse.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(enabled:, limits:) ⇒ QuotasResponse
Returns a new instance of QuotasResponse.
2055 2056 2057 2058 2059 |
# File 'lib/hook0/generated/models.rb', line 2055 def initialize(enabled:, limits:) @enabled = enabled @limits = limits freeze end |
Instance Attribute Details
#enabled ⇒ Object (readonly)
Returns the value of attribute enabled.
2050 2051 2052 |
# File 'lib/hook0/generated/models.rb', line 2050 def enabled @enabled end |
#limits ⇒ Object (readonly)
Returns the value of attribute limits.
2050 2051 2052 |
# File 'lib/hook0/generated/models.rb', line 2050 def limits @limits end |
Class Method Details
.from_json(value) ⇒ QuotasResponse
Read one out of what the API answered.
2065 2066 2067 2068 2069 2070 2071 |
# File 'lib/hook0/generated/models.rb', line 2065 def self.from_json(value) fields = Runtime.as_fields(value, "QuotasResponse") new( enabled: Runtime.read(fields, "enabled", Runtime::BOOLEAN), limits: Runtime.read(fields, "limits", QuotasResponseLimits.method(:from_json)) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
2087 2088 2089 |
# File 'lib/hook0/generated/models.rb', line 2087 def ==(other) other.is_a?(QuotasResponse) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
2095 2096 2097 |
# File 'lib/hook0/generated/models.rb', line 2095 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
2076 2077 2078 2079 2080 2081 |
# File 'lib/hook0/generated/models.rb', line 2076 def to_h out = {} out["enabled"] = @enabled out["limits"] = @limits.to_h out end |