Class: Hook0::Generated::IngestedEvent
- Inherits:
-
Object
- Object
- Hook0::Generated::IngestedEvent
- Defined in:
- lib/hook0/generated/models.rb
Overview
The IngestedEvent the API declares.
Instance Attribute Summary collapse
-
#application_id ⇒ Object
readonly
Returns the value of attribute application_id.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
-
#received_at ⇒ Object
readonly
Returns the value of attribute received_at.
Class Method Summary collapse
-
.from_json(value) ⇒ IngestedEvent
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(application_id:, event_id:, received_at:) ⇒ IngestedEvent
constructor
A new instance of IngestedEvent.
-
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
Constructor Details
#initialize(application_id:, event_id:, received_at:) ⇒ IngestedEvent
Returns a new instance of IngestedEvent.
1203 1204 1205 1206 1207 1208 |
# File 'lib/hook0/generated/models.rb', line 1203 def initialize(application_id:, event_id:, received_at:) @application_id = application_id @event_id = event_id @received_at = received_at freeze end |
Instance Attribute Details
#application_id ⇒ Object (readonly)
Returns the value of attribute application_id.
1196 1197 1198 |
# File 'lib/hook0/generated/models.rb', line 1196 def application_id @application_id end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
1196 1197 1198 |
# File 'lib/hook0/generated/models.rb', line 1196 def event_id @event_id end |
#received_at ⇒ Object (readonly)
Returns the value of attribute received_at.
1196 1197 1198 |
# File 'lib/hook0/generated/models.rb', line 1196 def received_at @received_at end |
Class Method Details
.from_json(value) ⇒ IngestedEvent
Read one out of what the API answered.
1214 1215 1216 1217 1218 1219 1220 1221 |
# File 'lib/hook0/generated/models.rb', line 1214 def self.from_json(value) fields = Runtime.as_fields(value, "IngestedEvent") new( application_id: Runtime.read(fields, "application_id", Runtime::UUID), event_id: Runtime.read(fields, "event_id", Runtime::UUID), received_at: Runtime.read(fields, "received_at", Runtime::DATE_TIME) ) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Whether that value carries the same members as this one.
1238 1239 1240 |
# File 'lib/hook0/generated/models.rb', line 1238 def ==(other) other.is_a?(IngestedEvent) && to_h == other.to_h end |
#hash ⇒ Integer
A value two equal instances share, so that either may key a hash.
1246 1247 1248 |
# File 'lib/hook0/generated/models.rb', line 1246 def hash to_h.hash end |
#to_h ⇒ Hash{String => Object}
Write one back the way the API reads it.
1226 1227 1228 1229 1230 1231 1232 |
# File 'lib/hook0/generated/models.rb', line 1226 def to_h out = {} out["application_id"] = @application_id out["event_id"] = @event_id out["received_at"] = Runtime.moment(@received_at) out end |