Class: Nexmo::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/nexmo/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_responseObject (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

Returns:

  • (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