Class: Oksky::Chat::Object::MessagesResource
- Inherits:
-
Base
- Object
- Base
- Oksky::Chat::Object::MessagesResource
show all
- Defined in:
- lib/oksky/chat/object/messages_resource.rb
Instance Method Summary
collapse
Methods inherited from Base
#[], #initialize
Instance Method Details
#content ⇒ String<Oksky::Chat::Event::Message>
30
31
32
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 30
def content
content_value('content')
end
|
#created_at ⇒ Time<Oksky::Chat::Event::Message>
64
65
66
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 64
def created_at
content_value("created_at")
end
|
#created_at_unix ⇒ Time<Oksky::Chat::Event::Message>
79
80
81
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 79
def created_at_unix
content_value("created_at_unix")
end
|
#deleted_at ⇒ Time<Oksky::Chat::Event::Message>
69
70
71
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 69
def deleted_at
content_value("deleted_at")
end
|
#deleted_at_unix ⇒ Time<Oksky::Chat::Event::Message>
84
85
86
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 84
def deleted_at_unix
content_value("deleted_at_unix")
end
|
25
26
27
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 25
def id
@src.dig("id")
end
|
#info ⇒ Hash<Oksky::Chat::Event::Message>
54
55
56
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 54
def info
content_value("info")
end
|
#kind ⇒ String<Oksky::Chat::Event::MessageKind::>
103
104
105
106
107
108
109
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 103
def message
if @src.has_key?('attributes')
@src['attributes']
else
@src
end
end
|
#relationships ⇒ Object
119
120
121
122
123
124
125
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 119
def relationships
if exist_relationships?
return @src['relationships']
else
{}
end
end
|
111
112
113
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 111
def room_id
@src.dig("relationships", "room", "data", "id")
end
|
#roomname ⇒ String<Oksky::Chat::Event::Message>
99
100
101
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 99
def roomname
content_value("roomname")
end
|
#settings ⇒ Hash<Oksky::Chat::Event::Message>
44
45
46
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 44
def settings
content_value("settings")
end
|
#status ⇒ String<Oksky::Chat::Event::Message>
49
50
51
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 49
def status
content_value("status")
end
|
59
60
61
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 59
def tags
content_value("tags")
end
|
#updated_at ⇒ Time<Oksky::Chat::Event::Message>
74
75
76
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 74
def updated_at
content_value("updated_at")
end
|
115
116
117
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 115
def user_id
@src.dig("relationships", "user", "data", "id")
end
|
#user_is_guest ⇒ Boolean<Oksky::Chat::Event::Message>
94
95
96
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 94
def user_is_guest
content_value("user_is_guest")
end
|
#username ⇒ String<Oksky::Chat::Event::Message>
89
90
91
|
# File 'lib/oksky/chat/object/messages_resource.rb', line 89
def username
content_value("username")
end
|