Method: Base#method_missing

Defined in:
lib/buscape_api/base.rb

#method_missing(method, *args) ⇒ Object



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/buscape_api/base.rb', line 54

def method_missing(method, *args)
  if @methods.include? method
    select_service method
    set_api
    set_app_id
    select_country if @options.include? :country_code
    self
  elsif method == :where
    parameterize args.first
    response = self.class.get(URI::encode(@url))['Result']
  else
    raise NoMethodError
  end
end