Class: Nexmo::Response
- Inherits:
-
Object
- Object
- Nexmo::Response
- Defined in:
- lib/nexmo/response.rb
Direct Known Subclasses
Applications::ListResponse, Numbers::ListResponse, Numbers::Response, Secrets::ListResponse, Voice::ListResponse
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.
5 6 7 8 9 |
# File 'lib/nexmo/response.rb', line 5 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
19 20 21 22 23 |
# File 'lib/nexmo/response.rb', line 19 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.
11 12 13 |
# File 'lib/nexmo/response.rb', line 11 def http_response @http_response end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
13 14 15 16 17 |
# File 'lib/nexmo/response.rb', line 13 def respond_to_missing?(name, include_private = false) return super if @entity.nil? @entity.respond_to?(name) end |