Class: SearsApi::Response

Inherits:
Object
  • Object
show all
Includes:
MethodMissingDeligation
Defined in:
lib/sears-api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from MethodMissingDeligation

#method_missing

Constructor Details

#initialize(resp) ⇒ Response

Returns a new instance of Response.



80
81
82
83
84
85
86
# File 'lib/sears-api.rb', line 80

def initialize(resp)
  @resp = resp

  %w[MercadoResult ProductDetail PromotionDetails showStoreLocator].each do |y|
    self.extend eval(ActiveSupport::Inflector.camelize(y)) if Ick::Try.instance.invoke(resp) {|x| x.first.first} == y
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class SearsApi::MethodMissingDeligation

Instance Attribute Details

#deligateObject

Returns the value of attribute deligate.



76
77
78
# File 'lib/sears-api.rb', line 76

def deligate
  @deligate
end

#respObject

Returns the value of attribute resp.



76
77
78
# File 'lib/sears-api.rb', line 76

def resp
  @resp
end