Class: Nexmo::Voice::Client
- Inherits:
-
Object
- Object
- Nexmo::Voice::Client
- Defined in:
- lib/nexmo/voice.rb
Instance Attribute Summary collapse
-
#api_config ⇒ Object
Returns the value of attribute api_config.
-
#calls ⇒ Object
Returns the value of attribute calls.
-
#nexmo_adaptor ⇒ Object
Returns the value of attribute nexmo_adaptor.
-
#ttses ⇒ Object
Returns the value of attribute ttses.
Instance Method Summary collapse
- #get(resource, entity = {}) ⇒ Object
-
#initialize(api_key, api_secret, options = {}) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(api_key, api_secret, options = {}) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/nexmo/voice.rb', line 15 def initialize(api_key, api_secret, = {}) @nexmo_adaptor = RestClient::Resource.new(BASE_URL, timeout: .fetch(:timeout, 10)) @api_config = { api_key: api_key, api_secret: api_secret } @calls = Calls.new(self) @ttses = Ttses.new(self) end |
Instance Attribute Details
#api_config ⇒ Object
Returns the value of attribute api_config.
12 13 14 |
# File 'lib/nexmo/voice.rb', line 12 def api_config @api_config end |
#calls ⇒ Object
Returns the value of attribute calls.
12 13 14 |
# File 'lib/nexmo/voice.rb', line 12 def calls @calls end |
#nexmo_adaptor ⇒ Object
Returns the value of attribute nexmo_adaptor.
12 13 14 |
# File 'lib/nexmo/voice.rb', line 12 def nexmo_adaptor @nexmo_adaptor end |
#ttses ⇒ Object
Returns the value of attribute ttses.
12 13 14 |
# File 'lib/nexmo/voice.rb', line 12 def ttses @ttses end |
Instance Method Details
#get(resource, entity = {}) ⇒ Object
27 28 29 |
# File 'lib/nexmo/voice.rb', line 27 def get(resource, entity = {}) @nexmo_adaptor[resource.class::RELATIVE_URL].get(params: entity.merge(@api_config)) end |