Class: Vonage::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/vonage/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.



5
6
7
8
9
# File 'lib/vonage/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



20
21
22
23
24
# File 'lib/vonage/response.rb', line 20

def method_missing(name, *args)
  return super if @entity.nil?

  @entity.public_send(name, *args)
end

Instance Attribute Details

#entityObject (readonly)

Returns the value of attribute entity.



12
13
14
# File 'lib/vonage/response.rb', line 12

def entity
  @entity
end

#http_responseObject (readonly)

Returns the value of attribute http_response.



11
12
13
# File 'lib/vonage/response.rb', line 11

def http_response
  @http_response
end

Instance Method Details

#respond_to_missing?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
18
# File 'lib/vonage/response.rb', line 14

def respond_to_missing?(name, include_private = false)
  return super if @entity.nil?

  @entity.respond_to?(name)
end