Skip to content

Commit ce216a8

Browse files
committed
bug fix for nil hash
1 parent d2fb5fc commit ce216a8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

lib/messagebird/base.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ module MessageBird
77
class Base
88
# takes each element from the given hash and apply it to ourselves through an assignment method
99
def map_hash_elements_to_self(hash)
10+
return if hash.nil?
11+
1012
hash.each do |key, value|
1113
method_name = key.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase # convert came case to snake case
1214
method_name += '='

0 commit comments

Comments
 (0)