Skip to content

Commit

Permalink
fixed id keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Vadim Senderovich committed Oct 13, 2013
1 parent 8c36172 commit 1d88e26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/example.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
require 'voxbone'
require 'pp'

voxbone = Voxbone.new(:username => 'test',
:password => 'test',
voxbone = Voxbone.new(:username => 'daddy',
:password => 'Airlines1!',
:wsdl => 'http://sandbox.voxbone.com/VoxAPI/services/VoxAPI?WSDL',
:endpoint => 'http://sandbox.voxbone.com/VoxAPI/services/VoxAPI',
:log_level => :debug)
Expand Down
5 changes: 4 additions & 1 deletion lib/voxbone/voxbone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ def create_user_token(params)
def capitalize_params(params)
capitalized_params= {}
params.each do |key, value|
key = key.to_s.split(/[ _]/).map(&:capitalize).join
key = key.to_s.split(/[ _]/).map do |part|
part.downcase == 'id' ? 'ID' : part.capitalize
end.join

value = (value.is_a?(Hash) ? capitalize_params(value) : value)
capitalized_params[key] = value
end
Expand Down

0 comments on commit 1d88e26

Please sign in to comment.