Class: Jammed::RandomJam

Inherits:
API
  • Object
show all
Defined in:
lib/jammed/random.rb

Overview

Provides method for calling API endpoint /random.json?

Class Method Summary collapse

Methods inherited from API

request

Class Method Details

.jam(api_key, https = false) ⇒ Object

Calls API for a random jam

Examples

Jammed::RandomJam.jam('08972935872035') #returns a random jam + the profile of the user


11
12
13
14
15
# File 'lib/jammed/random.rb', line 11

def self.jam(api_key, https=false)
  response = request(:get, "/random.json", {:https => https,
    :query => {:key => api_key}})
  JSON.parse(response.body)
end