intervals_api 1.5.0 → 1.5.1

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: cce3a3f046b8142d36271b6cf8dfe7466aec18bd
4
- data.tar.gz: e5684177e625ec589ecaeccfe036332b91933f0d
3
+ metadata.gz: 28f792607ddeff3949904c3b1186bc2f11ab07f4
4
+ data.tar.gz: 44240e86774fb89dfa49ebe7f2b4dd3ec85310f8
5
5
  SHA512:
6
- metadata.gz: 37ee0995d199062f12f922c874f353925d70a2b88a5e250e826a91993c5ae7996b9bbb5d432084498af926c8fa56571e2096530ee406f7bc0c1e704833d2611f
7
- data.tar.gz: c7bda2b717877b2b83178f93bad813cf500d43ba1401e90559af95a2403c9ce373c160910b07208f78b0c25da227e3d08e95c2a072639c76fd9630b0ce73aad8
6
+ metadata.gz: c923f62f162a21b3d8cace555788685645b93394f46f1af29a99c3b28e1c86c159a3efc38e32f46a248034da49f57f2064567cc8c3a4b156d409fd3656ef5521
7
+ data.tar.gz: c337f295d3cf4ce33f724afa95e0320fb4a25a8ca0546fa85acfa65f9e5e58c4955705b877979b73927983d9a02bc2ff5dd52e94b82c25e164922e19dc4cbcfe
@@ -12,23 +12,19 @@ module IntervalsAPI
12
12
  'Content-Type' => 'application/json',
13
13
  'Authorization' => "Basic #{Base64.encode64(token + ":X")}"
14
14
  },
15
- query: {},
16
- body: {}
17
15
  }
18
16
  end
19
17
 
20
18
  %w(get post put delete options).each do |request_type|
21
19
  define_method request_type do |url, options = {}|
20
+
21
+ query_options = @default_options
22
+ query_options[:headers].merge(options[:headers]) if options.key?(:header)
23
+ query_options[:query] = options[:query] if options.key?(:query)
24
+ query_options[:body ] = options[:body ].to_json if options.key?(:body)
25
+
22
26
  RecursiveOpenStruct.new(
23
- self.class.send(
24
- request_type,
25
- url,
26
- {
27
- headers: @default_options[:headers].merge( options[:headers].to_json),
28
- query: @default_options[:query].merge( options[:query].to_json),
29
- body: @default_options[:body].merge( options[:body].to_json)
30
- }
31
- )
27
+ self.class.send(request_type, url, query_options)
32
28
  )
33
29
  end
34
30
  end
@@ -1,3 +1,3 @@
1
1
  module IntervalsAPI
2
- VERSION='1.5.0'
2
+ VERSION='1.5.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intervals_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - interactive@staplegun.us