Class: Hook0::Generated::OrganizationInfoPlan
- Inherits:
-
Object
- Object
- Hook0::Generated::OrganizationInfoPlan
- Defined in:
- lib/hook0/generated/models.rb
Overview
The OrganizationInfoPlan the API declares.
Instance Attribute Summary collapse
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
-
.from_json(value) ⇒ OrganizationInfoPlan
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(label:, name:) ⇒ OrganizationInfoPlan
constructor
A new instance of OrganizationInfoPlan.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(label:, name:) ⇒ OrganizationInfoPlan
Returns a new instance of OrganizationInfoPlan.
1736 1737 1738 1739 1740 |
# File 'lib/hook0/generated/models.rb', line 1736 def initialize(label:, name:) @label = label @name = name freeze end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
1731 1732 1733 |
# File 'lib/hook0/generated/models.rb', line 1731 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1731 1732 1733 |
# File 'lib/hook0/generated/models.rb', line 1731 def name @name end |
Class Method Details
.from_json(value) ⇒ OrganizationInfoPlan
Read one out of what the API answered.
1746 1747 1748 1749 1750 1751 1752 |
# File 'lib/hook0/generated/models.rb', line 1746 def self.from_json(value) fields = Runtime.as_fields(value, "OrganizationInfoPlan") new( label: Runtime.read(fields, "label", Runtime::TEXT), name: Runtime.read(fields, "name", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1768 1769 1770 |
# File 'lib/hook0/generated/models.rb', line 1768 def ==(other) other.is_a?(OrganizationInfoPlan) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1776 1777 1778 |
# File 'lib/hook0/generated/models.rb', line 1776 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1757 1758 1759 1760 1761 1762 |
# File 'lib/hook0/generated/models.rb', line 1757 def to_h out = {} out["label"] = @label out["name"] = @name out end |