bigcartel-api 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8394aeb53563b44d32a5b410ff3e237c88f13364
4
- data.tar.gz: bc61e7136220fd7512c4d8beb34c260ca0873b9c
3
+ metadata.gz: c78f80999b938c0c4d44c8f8f3664916ad42d229
4
+ data.tar.gz: 2c46b802dea7c0ec5357429871931a6c6471ce52
5
5
  SHA512:
6
- metadata.gz: 730ae996d6baab3277989018c5b4b47ebd58992e89da315d6ee2d1c6fd33790e96a17c8d873219f0e3e6fb1584d46fd129b6fe4438fd84f8243bfb93071ffd20
7
- data.tar.gz: 9f67cc67807bb236bd3a950a52a076678ecd11cd34514184b9c8be0ce38511ea8cd9fd35a4d137a595149259bdd73ac9b5a6648b1ea3738e96a4ebe0ae1a47a5
6
+ metadata.gz: 3de29c54b64b7c673c407e2770ead59b0ea77d6186f76b8eebbfd936b755edce581fed637de1fabfc6e667f495ccf65a126a5b186b81bd0da451efe759715cb1
7
+ data.tar.gz: 64f156d90d1c8df5d4f5aad7df25509f1fd9c8ee96ed7e4d0065a75e584eb18961562f1126b741fe00c10a367479987a6cb19448067d3f480c5d270cfe79feca
@@ -5,11 +5,19 @@ module Bigcartel
5
5
  class API
6
6
  class << self
7
7
  def get(path)
8
- normalize_response RestClient.get(api_url(path), authorization: "Bearer #{Bigcartel.api_key}")
8
+ normalize_response RestClient.get(api_url(path), headers)
9
+ end
10
+
11
+ def put(path, options = {})
12
+ normalize_response RestClient.put(api_url(path), options.to_json, headers.merge(content_type: 'application/vnd.api+json'))
9
13
  end
10
14
 
11
15
  private
12
16
 
17
+ def headers
18
+ { authorization: "Bearer #{Bigcartel.api_key}" }
19
+ end
20
+
13
21
  def base_url
14
22
  "https://api.bigcartel.com"
15
23
  end
@@ -1,3 +1,3 @@
1
1
  module Bigcartel
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bigcartel-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dylan Montgomery
@@ -105,7 +105,7 @@ files:
105
105
  - LICENSE.txt
106
106
  - README.md
107
107
  - Rakefile
108
- - bigcartel.gemspec
108
+ - bigcartel-api.gemspec
109
109
  - lib/bigcartel.rb
110
110
  - lib/bigcartel/account.rb
111
111
  - lib/bigcartel/api.rb