Class: Hook0::Generated::OrganizationInfoConsumption
- Inherits:
-
Object
- Object
- Hook0::Generated::OrganizationInfoConsumption
- Defined in:
- lib/hook0/generated/models.rb
Overview
The OrganizationInfoConsumption the API declares.
Instance Attribute Summary collapse
-
#applications ⇒ Object
readonly
Returns the value of attribute applications.
-
#events_per_day ⇒ Object
readonly
Returns the value of attribute events_per_day.
-
#members ⇒ Object
readonly
Returns the value of attribute members.
Class Method Summary collapse
-
.from_json(value) ⇒ OrganizationInfoConsumption
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(applications: nil, events_per_day: nil, members: nil) ⇒ OrganizationInfoConsumption
constructor
A new instance of OrganizationInfoConsumption.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(applications: nil, events_per_day: nil, members: nil) ⇒ OrganizationInfoConsumption
Returns a new instance of OrganizationInfoConsumption.
1610 1611 1612 1613 1614 1615 |
# File 'lib/hook0/generated/models.rb', line 1610 def initialize(applications: nil, events_per_day: nil, members: nil) @applications = applications @events_per_day = events_per_day @members = members freeze end |
Instance Attribute Details
#applications ⇒ Object (readonly)
Returns the value of attribute applications.
1603 1604 1605 |
# File 'lib/hook0/generated/models.rb', line 1603 def applications @applications end |
#events_per_day ⇒ Object (readonly)
Returns the value of attribute events_per_day.
1603 1604 1605 |
# File 'lib/hook0/generated/models.rb', line 1603 def events_per_day @events_per_day end |
#members ⇒ Object (readonly)
Returns the value of attribute members.
1603 1604 1605 |
# File 'lib/hook0/generated/models.rb', line 1603 def members @members end |
Class Method Details
.from_json(value) ⇒ OrganizationInfoConsumption
Read one out of what the API answered.
1621 1622 1623 1624 1625 1626 1627 1628 |
# File 'lib/hook0/generated/models.rb', line 1621 def self.from_json(value) fields = Runtime.as_fields(value, "OrganizationInfoConsumption") new( applications: Runtime.maybe(fields, "applications", Runtime::INTEGER), events_per_day: Runtime.maybe(fields, "events_per_day", Runtime::INTEGER), members: Runtime.maybe(fields, "members", Runtime::INTEGER) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1645 1646 1647 |
# File 'lib/hook0/generated/models.rb', line 1645 def ==(other) other.is_a?(OrganizationInfoConsumption) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1653 1654 1655 |
# File 'lib/hook0/generated/models.rb', line 1653 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1633 1634 1635 1636 1637 1638 1639 |
# File 'lib/hook0/generated/models.rb', line 1633 def to_h out = {} out["applications"] = @applications unless @applications.nil? out["events_per_day"] = @events_per_day unless @events_per_day.nil? out["members"] = @members unless @members.nil? out end |