Class: Hook0::Generated::OrganizationInfoPlan

Inherits:
Object
  • Object
show all
Defined in:
lib/hook0/generated/models.rb

Overview

The OrganizationInfoPlan the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label:, name:) ⇒ OrganizationInfoPlan

Returns a new instance of OrganizationInfoPlan.

Parameters:

  • label (String)

    carries label.

  • name (String)

    carries name.



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

#labelObject (readonly)

Returns the value of attribute label.



1731
1732
1733
# File 'lib/hook0/generated/models.rb', line 1731

def label
  @label
end

#nameObject (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.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



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.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


1768
1769
1770
# File 'lib/hook0/generated/models.rb', line 1768

def ==(other)
  other.is_a?(OrganizationInfoPlan) && to_h == other.to_h
end

#hashInteger

A value two equal instances share, so that either may key a hash.

Returns:

  • (Integer)


1776
1777
1778
# File 'lib/hook0/generated/models.rb', line 1776

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


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