Class: Hook0::Generated::ReplayEvent

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

Overview

The ReplayEvent the API declares.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application_id:) ⇒ ReplayEvent

Returns a new instance of ReplayEvent.

Parameters:

  • application_id (String)

    carries application_id.



2206
2207
2208
2209
# File 'lib/hook0/generated/models.rb', line 2206

def initialize(application_id:)
  @application_id = application_id
  freeze
end

Instance Attribute Details

#application_idObject (readonly)

Returns the value of attribute application_id.



2203
2204
2205
# File 'lib/hook0/generated/models.rb', line 2203

def application_id
  @application_id
end

Class Method Details

.from_json(value) ⇒ ReplayEvent

Read one out of what the API answered.

Parameters:

  • value (Object)

    the JSON document the API answered

Returns:



2215
2216
2217
2218
2219
2220
# File 'lib/hook0/generated/models.rb', line 2215

def self.from_json(value)
  fields = Runtime.as_fields(value, "ReplayEvent")
  new(
    application_id: Runtime.read(fields, "application_id", Runtime::UUID)
  )
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)


2235
2236
2237
# File 'lib/hook0/generated/models.rb', line 2235

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

#hashInteger

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

Returns:

  • (Integer)


2243
2244
2245
# File 'lib/hook0/generated/models.rb', line 2243

def hash
  to_h.hash
end

#to_hHash{String => Object}

Write one back the way the API reads it.

Returns:

  • (Hash{String => Object})


2225
2226
2227
2228
2229
# File 'lib/hook0/generated/models.rb', line 2225

def to_h
  out = {}
  out["application_id"] = @application_id
  out
end