Class: ClassyPlivo::RestAPI
- Inherits:
-
Object
- Object
- ClassyPlivo::RestAPI
- Defined in:
- lib/classy_plivo/rest_api.rb
Instance Attribute Summary collapse
-
#plivo_api ⇒ Object
readonly
Returns the value of attribute plivo_api.
Instance Method Summary collapse
-
#initialize(*args) ⇒ RestAPI
constructor
A new instance of RestAPI.
- #method_missing(method, *args, &block) ⇒ Object
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_api ⇒ Object (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 |