Class: Essential::Account
Class Method Summary
collapse
Instance Method Summary
collapse
#update
Methods inherited from Resource
#==, #as_json, #fetch, #init_from, #inspect, #loaded?, request, #to_json
#filter_attrs, included
Constructor Details
#initialize(sid: nil, headers: nil, attrs: nil) ⇒ Account
Returns a new instance of Account.
18
19
20
21
22
|
# File 'lib/essential/account.rb', line 18
def initialize(sid: nil, headers: nil, attrs: nil)
sid ||= Essential.sid
super(sid: sid, headers: , attrs: attrs)
end
|
Class Method Details
.retrieve(opts = {}, headers: {}) ⇒ Object
8
9
10
11
12
|
# File 'lib/essential/account.rb', line 8
def self.retrieve(opts={}, headers: {})
me = self.new(headers: )
me.fetch
me
end
|
.url ⇒ Object
14
15
16
|
# File 'lib/essential/account.rb', line 14
def self.url
"/v2/account"
end
|
Instance Method Details
#channels ⇒ Object
28
29
30
|
# File 'lib/essential/account.rb', line 28
def channels
Essential::Resource::PaginatorProxy.new(Essential::Messaging::Channel, headers: )
end
|
#messages ⇒ Object
40
41
42
|
# File 'lib/essential/account.rb', line 40
def messages
Essential::Resource::PaginatorProxy.new(Essential::Messaging::Message, headers: )
end
|
#subscribers ⇒ Object
32
33
34
|
# File 'lib/essential/account.rb', line 32
def subscribers
Essential::Resource::PaginatorProxy.new(Essential::Messaging::Subscriber, headers: )
end
|
#transports ⇒ Object
36
37
38
|
# File 'lib/essential/account.rb', line 36
def transports
Essential::Resource::PaginatorProxy.new(Essential::Messaging::Transport, headers: )
end
|
#url ⇒ Object
24
25
26
|
# File 'lib/essential/account.rb', line 24
def url
self.class.url
end
|