Class: Hook0::Generated::ApplicationInfoConsumption
- Inherits:
-
Object
- Object
- Hook0::Generated::ApplicationInfoConsumption
- Defined in:
- lib/hook0/generated/models.rb
Overview
The ApplicationInfoConsumption the API declares.
Instance Attribute Summary collapse
-
#events_per_day ⇒ Object
readonly
Returns the value of attribute events_per_day.
Class Method Summary collapse
-
.from_json(value) ⇒ ApplicationInfoConsumption
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(events_per_day: nil) ⇒ ApplicationInfoConsumption
constructor
A new instance of ApplicationInfoConsumption.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(events_per_day: nil) ⇒ ApplicationInfoConsumption
Returns a new instance of ApplicationInfoConsumption.
396 397 398 399 |
# File 'lib/hook0/generated/models.rb', line 396 def initialize(events_per_day: nil) @events_per_day = events_per_day freeze end |
Instance Attribute Details
#events_per_day ⇒ Object (readonly)
Returns the value of attribute events_per_day.
393 394 395 |
# File 'lib/hook0/generated/models.rb', line 393 def events_per_day @events_per_day end |
Class Method Details
.from_json(value) ⇒ ApplicationInfoConsumption
Read one out of what the API answered.
405 406 407 408 409 410 |
# File 'lib/hook0/generated/models.rb', line 405 def self.from_json(value) fields = Runtime.as_fields(value, "ApplicationInfoConsumption") new( events_per_day: Runtime.maybe(fields, "events_per_day", Runtime::INTEGER) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
425 426 427 |
# File 'lib/hook0/generated/models.rb', line 425 def ==(other) other.is_a?(ApplicationInfoConsumption) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
433 434 435 |
# File 'lib/hook0/generated/models.rb', line 433 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
415 416 417 418 419 |
# File 'lib/hook0/generated/models.rb', line 415 def to_h out = {} out["events_per_day"] = @events_per_day unless @events_per_day.nil? out end |