Class: Hook0::Generated::OrganizationPlan
- Inherits:
-
Object
- Object
- Hook0::Generated::OrganizationPlan
- Defined in:
- lib/hook0/generated/models.rb
Overview
The OrganizationPlan 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) ⇒ OrganizationPlan
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:) ⇒ OrganizationPlan
constructor
A new instance of OrganizationPlan.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(label:, name:) ⇒ OrganizationPlan
Returns a new instance of OrganizationPlan.
1926 1927 1928 1929 1930 |
# File 'lib/hook0/generated/models.rb', line 1926 def initialize(label:, name:) @label = label @name = name freeze end |
Instance Attribute Details
#label ⇒ Object (readonly)
Returns the value of attribute label.
1921 1922 1923 |
# File 'lib/hook0/generated/models.rb', line 1921 def label @label end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
1921 1922 1923 |
# File 'lib/hook0/generated/models.rb', line 1921 def name @name end |
Class Method Details
.from_json(value) ⇒ OrganizationPlan
Read one out of what the API answered.
1936 1937 1938 1939 1940 1941 1942 |
# File 'lib/hook0/generated/models.rb', line 1936 def self.from_json(value) fields = Runtime.as_fields(value, "OrganizationPlan") 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.
1958 1959 1960 |
# File 'lib/hook0/generated/models.rb', line 1958 def ==(other) other.is_a?(OrganizationPlan) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1966 1967 1968 |
# File 'lib/hook0/generated/models.rb', line 1966 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1947 1948 1949 1950 1951 1952 |
# File 'lib/hook0/generated/models.rb', line 1947 def to_h out = {} out["label"] = @label out["name"] = @name out end |