lbd_sdk 0.1.0 → 0.1.3

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.
@@ -0,0 +1,17 @@
1
+ module LbdSdk
2
+ module HashConverter
3
+ def camelize(hash)
4
+ hash.each_with_object({}) do |(key, value), new_hash|
5
+ lower_case_key =
6
+ key
7
+ .to_s
8
+ .split('_')
9
+ .map(&:capitalize)
10
+ .join
11
+ .sub(/./) { $&.downcase }
12
+ .to_sym
13
+ new_hash[lower_case_key] = value.is_a?(Hash) ? camelize(value) : value
14
+ end
15
+ end
16
+ end
17
+ end
@@ -19,13 +19,9 @@ module LbdSdk
19
19
  # @return [Net::HTTP]
20
20
  def http(uri)
21
21
  http = Net::HTTP.new(uri.host, uri.port)
22
- if uri.scheme == 'https'
23
- http.use_ssl = true
24
- end
22
+ http.use_ssl = true if uri.scheme == 'https'
25
23
 
26
- http_options&.each do |key, value|
27
- http.send("#{key}=", value)
28
- end
24
+ http_options&.each { |key, value| http.send("#{key}=", value) }
29
25
 
30
26
  http
31
27
  end
@@ -53,4 +49,4 @@ module LbdSdk
53
49
  http.request(request)
54
50
  end
55
51
  end
56
- end
52
+ end