restify 0.1.2.1.b33 → 0.1.2.1.b34

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YzRiMjc4OTlkOGVmZTI1NmVlYmE5OTAxMjY3ZDE3MGYyZTc4YzQ4OA==
4
+ NjZhNWQ1YzA2YmVmZDFlMWViZTBhY2QxMmVkMmUzM2EzNDU1YjY0MQ==
5
5
  data.tar.gz: !binary |-
6
- YTI3NzZhM2VlYjg4YTIxZGVmYTAyN2QwYWVjZTFlZGZkYjIwMDg2NA==
6
+ YmU5OGEyOGUxOGZmY2Q2YTA1N2U2ZTI2NTIzMDhiYjcwNWRjN2UyNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- Y2Y3MTdlOTliYzYwYzFiMjkxMjQ5ZWUzMDNkODY5MzVkNjc0N2M5ZjkwZTI2
10
- N2E2YTIwYmMxNTI1OGUxZDdhZGVjOWY2ZTg2ZjMzN2VmNzc3MDRhNDJiOWJj
11
- MTQzN2E3NjgzYmFmNTRhYjFmNTBmZmUyM2I2OTgyZjVkN2NmMjc=
9
+ NWYyYjk3NDY1ZjQxYzVlZGQwOGM4MzFmN2Q3MjJhZmVlOWNlYWY2OWY0ZTc4
10
+ MjJmZThmZGRmYjA0MDA5MTY4N2JjZDA0ZGE0MWQ4Y2FhYjRkNDZkODI4YjJj
11
+ ZWY5YWI3OWExYWJjYjcxOGQ4NDYyYmM4M2FjMGQ2MTYyN2RhZWM=
12
12
  data.tar.gz: !binary |-
13
- MzhhNDcyMzA5MDJmNjcxOGFkZGFhN2I1M2NiNGM1NmI3YWVmYzhkNTY0ZTM5
14
- YTI3NjY2NWE4ZWRjNjQyOTM4NzQxNDBjYzViOTkzYTA3NjUyMmE4MTdmNWVk
15
- Njg4MTgwNDk5OGZiZGFmMWFkMWVmOWE1OGY5YmE5Yzk0ZmQ1Zjc=
13
+ NGQzNWRhZmRmMzkwYzUwYzY2N2U5ZGUzOTA0MjQ0YmVmYTg0YWQzZWZmNThk
14
+ NjA3YzAyYmIyN2IxNmFmZTJjODAzYjcyZTFkMmY0YmU4NWI4M2RiNTgxYzNk
15
+ NDVjZDljYjRhNDU0ZjkzZmQ3ZTRhNWVlZWZlZWU0NmVmNTc1Y2I=
@@ -57,7 +57,7 @@ module Restify
57
57
  #
58
58
  # Keys that should not be extracted from options
59
59
  # to expand URI templates.
60
- RESERVED_KEYS = [:data]
60
+ RESERVED_KEYS = %w(data)
61
61
 
62
62
  # @api private
63
63
  #
@@ -40,10 +40,23 @@ module Restify
40
40
 
41
41
  def request(method, opts = {})
42
42
  keys = template.variables - Client::RESERVED_KEYS
43
- params = Hash[keys.map{|key| [key, opts.delete(:key)]}]
43
+ params = extract_params(opts, keys)
44
44
  uri = template.expand(params)
45
45
 
46
46
  client.request method, uri, opts
47
47
  end
48
+
49
+ def extract_params(opts, keys)
50
+ params = {}
51
+ keys.each do |key|
52
+ if opts.key?(key)
53
+ params[key] = opts.delete(key)
54
+ elsif opts.key?(key.to_sym)
55
+ params[key] = opts.delete(key.to_sym)
56
+ end
57
+ end
58
+
59
+ params
60
+ end
48
61
  end
49
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2.1.b33
4
+ version: 0.1.2.1.b34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen