Sha256: e8983d45fa3115cb150f17367556854ab478bc9cbcc41ce571b04509091da55b

Contents?: true

Size: 511 Bytes

Versions: 6

Compression:

Stored size: 511 Bytes

Contents

require "httparty"
require "multi_json"

module DribbbleBucketApi
	class OfficialApi

		include HTTParty
		base_uri "api.dribbble.com"

		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

	end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dribbble-bucket-api-0.0.6 lib/dribbble_bucket_api/official_api.rb
dribbble-bucket-api-0.0.5 lib/dribbble_bucket_api/official_api.rb
dribbble-bucket-api-0.0.4 lib/dribbble_bucket_api/official_api.rb
dribbble-bucket-api-0.0.3 lib/dribbble_bucket_api/official_api.rb
dribbble-bucket-api-0.0.2 lib/dribbble_bucket_api/official_api.rb
dribbble-bucket-api-0.0.1 lib/dribbble_bucket_api/official_api.rb