Class: Sendbird::MetaBase
- Inherits:
-
Object
- Object
- Sendbird::MetaBase
show all
- Extended by:
- Client
- Defined in:
- lib/sendbird/meta_base.rb
Constant Summary
Constants included
from Client
Client::PUBLIC_METHODS
Class Method Summary
collapse
-
.build_url(*args) ⇒ Object
-
.create(channel_type, channel_url, body) ⇒ Object
-
.destroy(channel_type, channel_url) ⇒ Object
-
.destroy_by_key(channel_type, channel_url, key) ⇒ Object
-
.endpoint ⇒ Object
-
.update(channel_type, channel_url, body) ⇒ Object
-
.update_by_key(channel_type, channel_url, key, body) ⇒ Object
-
.view(channel_type, channel_url, params = {}) ⇒ Object
-
.view_by_key(channel_type, channel_url, key) ⇒ Object
Methods included from Client
build_url
Class Method Details
.build_url(*args) ⇒ Object
38
39
40
41
|
# File 'lib/sendbird/meta_base.rb', line 38
def self.build_url(*args)
args_dup = args.dup
args_dup.join('/')
end
|
.create(channel_type, channel_url, body) ⇒ Object
5
6
7
|
# File 'lib/sendbird/meta_base.rb', line 5
def create(channel_type, channel_url, body)
post(path: build_url(channel_type, channel_url, endpoint), body: body)
end
|
.destroy(channel_type, channel_url) ⇒ Object
25
26
27
|
# File 'lib/sendbird/meta_base.rb', line 25
def destroy(channel_type, channel_url)
delete(path: build_url(channel_type, channel_url, endpoint))
end
|
.destroy_by_key(channel_type, channel_url, key) ⇒ Object
29
30
31
|
# File 'lib/sendbird/meta_base.rb', line 29
def destroy_by_key(channel_type, channel_url, key)
delete(path: build_url(channel_type, channel_url, endpoint, key))
end
|
.endpoint ⇒ Object
34
35
36
|
# File 'lib/sendbird/meta_base.rb', line 34
def self.endpoint
self.const_get('ENDPOINT')
end
|
.update(channel_type, channel_url, body) ⇒ Object
17
18
19
|
# File 'lib/sendbird/meta_base.rb', line 17
def update(channel_type, channel_url, body)
put(path: build_url(channel_type, channel_url, endpoint), body: body)
end
|
.update_by_key(channel_type, channel_url, key, body) ⇒ Object
21
22
23
|
# File 'lib/sendbird/meta_base.rb', line 21
def update_by_key(channel_type, channel_url, key, body)
put(path: build_url(channel_type, channel_url, endpoint, key), body: body)
end
|
.view(channel_type, channel_url, params = {}) ⇒ Object
9
10
11
|
# File 'lib/sendbird/meta_base.rb', line 9
def view(channel_type, channel_url, params={})
get(path: build_url(channel_type, channel_url, endpoint), params: params)
end
|
.view_by_key(channel_type, channel_url, key) ⇒ Object
13
14
15
|
# File 'lib/sendbird/meta_base.rb', line 13
def view_by_key(channel_type, channel_url, key)
get(path: build_url(channel_type, channel_url, endpoint, key))
end
|