Class: ClassyPlivo::RestAPI

Inherits:
Object
  • Object
show all
Defined in:
lib/classy_plivo/rest_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ RestAPI

Returns a new instance of RestAPI.



5
6
7
# File 'lib/classy_plivo/rest_api.rb', line 5

def initialize(*args)
  @plivo_api = Plivo::RestAPI.new(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/classy_plivo/rest_api.rb', line 9

def method_missing(method, *args, &block)
  result = plivo_api.send(method, *args, &block)
  if resembles_plivo_response?(result)
    Response.new(result)
  else
    result
  end
end

Instance Attribute Details

#plivo_apiObject (readonly)

Returns the value of attribute plivo_api.



3
4
5
# File 'lib/classy_plivo/rest_api.rb', line 3

def plivo_api
  @plivo_api
end