Class: FatSecret::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/fat_secret/connection.rb

Class Method Summary collapse

Class Method Details

.get(method, params) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fat_secret/connection.rb', line 10

def get(method, params)
  FatSecret.configuration.logger.debug(
    "FatSecret::Connection.get #{method} with #{params}"
  )

  params = default_parameters.merge(params).merge(method: method)
  uri = request_uri('GET', params)
  # response = Typhoeus.get(
  #   "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}",
  #   params: params, followlocation: true
  # )
  Yajl::Parser.parse(uri.read)
end