Class: Hook0::Generated::EventType
- Inherits:
-
Object
- Object
- Hook0::Generated::EventType
- Defined in:
- lib/hook0/generated/models.rb
Overview
The EventType the API declares.
Instance Attribute Summary collapse
-
#event_type_name ⇒ Object
readonly
Returns the value of attribute event_type_name.
-
#resource_type_name ⇒ Object
readonly
Returns the value of attribute resource_type_name.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
-
#verb_name ⇒ Object
readonly
Returns the value of attribute verb_name.
Class Method Summary collapse
-
.from_json(value) ⇒ EventType
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(event_type_name:, resource_type_name:, service_name:, verb_name:) ⇒ EventType
constructor
A new instance of EventType.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(event_type_name:, resource_type_name:, service_name:, verb_name:) ⇒ EventType
Returns a new instance of EventType.
917 918 919 920 921 922 923 |
# File 'lib/hook0/generated/models.rb', line 917 def initialize(event_type_name:, resource_type_name:, service_name:, verb_name:) @event_type_name = event_type_name @resource_type_name = resource_type_name @service_name = service_name @verb_name = verb_name freeze end |
Instance Attribute Details
#event_type_name ⇒ Object (readonly)
Returns the value of attribute event_type_name.
908 909 910 |
# File 'lib/hook0/generated/models.rb', line 908 def event_type_name @event_type_name end |
#resource_type_name ⇒ Object (readonly)
Returns the value of attribute resource_type_name.
908 909 910 |
# File 'lib/hook0/generated/models.rb', line 908 def resource_type_name @resource_type_name end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
908 909 910 |
# File 'lib/hook0/generated/models.rb', line 908 def service_name @service_name end |
#verb_name ⇒ Object (readonly)
Returns the value of attribute verb_name.
908 909 910 |
# File 'lib/hook0/generated/models.rb', line 908 def verb_name @verb_name end |
Class Method Details
.from_json(value) ⇒ EventType
Read one out of what the API answered.
929 930 931 932 933 934 935 936 937 |
# File 'lib/hook0/generated/models.rb', line 929 def self.from_json(value) fields = Runtime.as_fields(value, "EventType") new( event_type_name: Runtime.read(fields, "event_type_name", Runtime::TEXT), resource_type_name: Runtime.read(fields, "resource_type_name", Runtime::TEXT), service_name: Runtime.read(fields, "service_name", Runtime::TEXT), verb_name: Runtime.read(fields, "verb_name", Runtime::TEXT) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
955 956 957 |
# File 'lib/hook0/generated/models.rb', line 955 def ==(other) other.is_a?(EventType) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
963 964 965 |
# File 'lib/hook0/generated/models.rb', line 963 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
942 943 944 945 946 947 948 949 |
# File 'lib/hook0/generated/models.rb', line 942 def to_h out = {} out["event_type_name"] = @event_type_name out["resource_type_name"] = @resource_type_name out["service_name"] = @service_name out["verb_name"] = @verb_name out end |