Class: CDP::Timeline::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/cdp/timeline/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event_uuid: nil, event_identifier: nil, event_type: nil, event_timestamp: nil, event_canceled_at: nil, payload: nil) ⇒ Event

Returns a new instance of Event.


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/cdp/timeline/event.rb', line 11

def initialize(
  event_uuid: nil,
  event_identifier: nil,
  event_type: nil,
  event_timestamp: nil,
  event_canceled_at: nil,
  payload: nil
)
  @event_uuid = event_uuid
  @event_identifier = event_identifier
  @event_type = event_type
  @event_timestamp = event_timestamp
  @event_canceled_at = event_canceled_at
  @payload = payload
end

Instance Attribute Details

#event_canceled_atObject

Returns the value of attribute event_canceled_at.


8
9
10
# File 'lib/cdp/timeline/event.rb', line 8

def event_canceled_at
  @event_canceled_at
end

#event_identifierObject

Returns the value of attribute event_identifier.


5
6
7
# File 'lib/cdp/timeline/event.rb', line 5

def event_identifier
  @event_identifier
end

#event_timestampObject

Returns the value of attribute event_timestamp.


7
8
9
# File 'lib/cdp/timeline/event.rb', line 7

def event_timestamp
  @event_timestamp
end

#event_typeObject

Returns the value of attribute event_type.


6
7
8
# File 'lib/cdp/timeline/event.rb', line 6

def event_type
  @event_type
end

#event_uuidObject

Returns the value of attribute event_uuid.


4
5
6
# File 'lib/cdp/timeline/event.rb', line 4

def event_uuid
  @event_uuid
end

#payloadObject

Returns the value of attribute payload.


9
10
11
# File 'lib/cdp/timeline/event.rb', line 9

def payload
  @payload
end

Instance Method Details

#==(o) ⇒ Object


27
28
29
30
31
32
33
34
35
36
# File 'lib/cdp/timeline/event.rb', line 27

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
    event_uuid == o.event_uuid &&
    event_identifier == o.event_identifier &&
    event_timestamp == o.event_timestamp &&
    event_canceled_at == o.event_canceled_at &&
    event_type == o.event_type &&
    payload == o.payload
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method

40
41
42
# File 'lib/cdp/timeline/event.rb', line 40

def eql?(o)
  self == o
end

#to_hashObject


44
45
46
47
48
49
50
51
52
53
# File 'lib/cdp/timeline/event.rb', line 44

def to_hash
  {
    event_uuid: event_uuid,
    event_identifier: event_identifier,
    event_type: event_type,
    event_timestamp: event_timestamp,
    event_canceled_at: event_canceled_at,
    payload: payload,
  }
end