Class: Nexmo::Voice::Client
- Inherits:
-
Object
- Object
- Nexmo::Voice::Client
- Defined in:
- lib/nexmo/voice.rb
Constant Summary collapse
- DEFAULT_TIMEOUT =
10
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.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/nexmo/voice.rb', line 17 def initialize(api_key, api_secret, = {}) @nexmo_adaptor = RestClient::Resource.new( BASE_URL, read_timeout: .fetch(:read_timeout) { DEFAULT_TIMEOUT }, open_timeout: .fetch(:open_timeout) { DEFAULT_TIMEOUT } ) @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.
14 15 16 |
# File 'lib/nexmo/voice.rb', line 14 def api_config @api_config end |
#calls ⇒ Object
Returns the value of attribute calls.
14 15 16 |
# File 'lib/nexmo/voice.rb', line 14 def calls @calls end |
#nexmo_adaptor ⇒ Object
Returns the value of attribute nexmo_adaptor.
14 15 16 |
# File 'lib/nexmo/voice.rb', line 14 def nexmo_adaptor @nexmo_adaptor end |
#ttses ⇒ Object
Returns the value of attribute ttses.
14 15 16 |
# File 'lib/nexmo/voice.rb', line 14 def ttses @ttses end |
Instance Method Details
#get(resource, entity = {}) ⇒ Object
34 35 36 37 |
# File 'lib/nexmo/voice.rb', line 34 def get(resource, entity = {}) @nexmo_adaptor[resource.class::RELATIVE_URL] .get(params: entity.merge(@api_config)) end |