Class: Dmm::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

attr_reader, #initialize

Constructor Details

This class inherits a constructor from Dmm::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



16
17
18
19
# File 'lib/dmm/response.rb', line 16

def method_missing(method, *args)
  return super unless result.respond_to? method.to_sym
  result.send(method.to_sym)
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



6
7
8
# File 'lib/dmm/response.rb', line 6

def response
  @response
end

Instance Method Details

#respond_to?(method, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


22
# File 'lib/dmm/response.rb', line 22

def respond_to?(method, include_private = false); result.respond_to?(method.to_sym, include_private) || super; end

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

Returns:

  • (Boolean)


21
# File 'lib/dmm/response.rb', line 21

def respond_to_missing?(method, include_private = false); result.respond_to?(method.to_sym, include_private) || super; end

#resultDmm::Result

Delegate to a Dmm::Result

Returns:



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

def result
  @result ||= Dmm::Result.new @attrs[:response][:result]
  @result
end