Class: DribbbleBucketApi::OfficialApi

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/dribbble_bucket_api/official_api.rb

Instance Method Summary collapse

Instance Method Details

#get_shot_properties(id) ⇒ Object



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

def get_shot_properties(id)
  response = self.class.get("/shots/#{id}.json")
  # ensure it was a successful response
  unless response.code == 200
    raise StandardError, %Q(
      Response returned #{response.code}
      Body:
      #{response.body}
    )
  end
  # return the JSON object as a hash
  MultiJson.load(response.body, symbolize_keys: true)
end