Class: Async::Matrix::ApplicationService::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/async/matrix/application_service/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Event

Returns a new instance of Event.



25
26
27
28
29
30
31
32
# File 'lib/async/matrix/application_service/event.rb', line 25

def initialize(data)
	@type      = data["type"]
	@sender    = data["sender"]
	@room_id   = data["room_id"]
	@state_key = data["state_key"]
	@event_id  = data["event_id"]
	@content   = Content.new(data["content"] || {})
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def content
  @content
end

#event_idObject (readonly)

Returns the value of attribute event_id.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def event_id
  @event_id
end

#room_idObject (readonly)

Returns the value of attribute room_id.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def room_id
  @room_id
end

#senderObject (readonly)

Returns the value of attribute sender.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def sender
  @sender
end

#state_keyObject (readonly)

Returns the value of attribute state_key.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def state_key
  @state_key
end

#typeObject (readonly)

Returns the value of attribute type.



23
24
25
# File 'lib/async/matrix/application_service/event.rb', line 23

def type
  @type
end