Class: Oksky::Chat::Object::RoomsResource
- Inherits:
-
Base
- Object
- Base
- Oksky::Chat::Object::RoomsResource
show all
- Defined in:
- lib/oksky/chat/object/rooms_resource.rb
Instance Method Summary
collapse
Methods inherited from Base
#[], #initialize
Instance Method Details
#awaiting_support ⇒ Time<Oksky::Chat::Event::Room>
58
59
60
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 58
def awaiting_support
content_value("awaiting_support")
end
|
#client_id ⇒ Object
98
99
100
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 98
def client_id
@src.dig("relationships", "client", "data", "id")
end
|
#create_user_id ⇒ Object
94
95
96
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 94
def create_user_id
@src.dig("relationships", "create_user", "data", "id")
end
|
#created_at ⇒ Time<Oksky::Chat::Event::Room>
68
69
70
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 68
def created_at
content_value("created_at")
end
|
#created_at_unix ⇒ Time<Oksky::Chat::Event::Room>
63
64
65
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 63
def created_at_unix
content_value("created_at_unix")
end
|
#description ⇒ Hash<Oksky::Chat::Event::Room>
33
34
35
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 33
def description
content_value("description")
end
|
#enabled ⇒ Time<Oksky::Chat::Event::Room>
48
49
50
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 48
def enabled
content_value("enabled")
end
|
#helped_room_id ⇒ Object
102
103
104
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 102
def helped_room_id
@src.dig("relationships", "helped_room", "data", "id")
end
|
14
15
16
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 14
def id
@src.dig("id")
end
|
#is_external ⇒ Boolean<Oksky::Chat::Event::Room>
78
79
80
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 78
def is_external
content_value("is_external")
end
|
#is_private ⇒ String<Oksky::Chat::Event::Room>
38
39
40
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 38
def is_private
content_value("is_private")
end
|
#kind ⇒ String<Oksky::Chat::Event::RoomKind::>
24
25
26
27
28
29
30
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 24
def kind
begin
Oksky::Chat::Event::RoomsResourceKind.const_get(content_value("kind").split("_").map{|w| w[0] = w[0].capitalize; w}.join)
rescue NameError => e
Oksky::Chat::Event::RoomsResourceKind::Unsupport
end
end
|
#name ⇒ String<Oksky::Chat::Event::Room>
19
20
21
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 19
def name
content_value('name')
end
|
#relationships ⇒ Object
106
107
108
109
110
111
112
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 106
def relationships
if exist_relationships?
return @src['relationships']
else
{}
end
end
|
82
83
84
85
86
87
88
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 82
def room
if @src.has_key?('attributes')
@src['attributes']
else
@src
end
end
|
#room_code ⇒ Time<Oksky::Chat::Event::Room>
53
54
55
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 53
def room_code
content_value("room_code")
end
|
#settings ⇒ Hash<Oksky::Chat::Event::Room>
43
44
45
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 43
def settings
content_value("info")
end
|
#support_group_id ⇒ Object
90
91
92
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 90
def support_group_id
@src.dig("relationships", "relationships", "data", "id")
end
|
#unread_message_count ⇒ String<Oksky::Chat::Event::Room>
73
74
75
|
# File 'lib/oksky/chat/object/rooms_resource.rb', line 73
def unread_message_count
content_value("unread_message_count")
end
|