Skip to content

Commit f06582c

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 46ef2f7 + aa364f2 commit f06582c

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v0.12.1.pre
2+
3+
* bug-fixes
4+
* Fix camelize function for hashes containing arrays
5+
16
### v0.12.0.pre
27

38
* features

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
beyond_api (0.12.0.pre)
4+
beyond_api (0.12.1.pre)
55
faraday (~> 0.15)
66

77
GEM

lib/beyond_api/ext.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ class Hash
44
def deep_transform_keys(&block)
55
result = {}
66
each do |key, value|
7-
result[yield(key)] = value.is_a?(Hash) ? value.deep_transform_keys(&block) : value
7+
result[yield(key)] = case value
8+
when Hash
9+
value.deep_transform_keys(&block)
10+
when Array
11+
value.camelize_keys
12+
else
13+
value
14+
end
815
end
916
result
1017
end

lib/beyond_api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module BeyondApi
2-
VERSION = "0.12.0.pre".freeze
2+
VERSION = "0.12.1.pre".freeze
33
end

0 commit comments

Comments
 (0)