Class: Nexmo::Response
- Inherits:
-
Object
- Object
- Nexmo::Response
- Defined in:
- lib/nexmo/response.rb
Direct Known Subclasses
Applications::ListResponse, Calls::ListResponse, NumberInsight::Response, Numbers::ListResponse, Numbers::Response, SMS::Response, Secrets::ListResponse, Verify::Response
Instance Attribute Summary collapse
-
#http_response ⇒ Object
readonly
Returns the value of attribute http_response.
Instance Method Summary collapse
-
#initialize(entity = nil, http_response = nil) ⇒ Response
constructor
A new instance of Response.
- #method_missing(name, *args) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(entity = nil, http_response = nil) ⇒ Response
Returns a new instance of Response.
3 4 5 6 7 |
# File 'lib/nexmo/response.rb', line 3 def initialize(entity=nil, http_response=nil) @entity = entity @http_response = http_response end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
17 18 19 20 21 |
# File 'lib/nexmo/response.rb', line 17 def method_missing(name, *args) return super if @entity.nil? @entity.public_send(name, *args) end |
Instance Attribute Details
#http_response ⇒ Object (readonly)
Returns the value of attribute http_response
9 10 11 |
# File 'lib/nexmo/response.rb', line 9 def http_response @http_response end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
11 12 13 14 15 |
# File 'lib/nexmo/response.rb', line 11 def respond_to_missing?(name, include_private = false) return super if @entity.nil? @entity.respond_to?(name) end |