lib/hubspot/utils.rb in hubspot-ruby-0.1.4 vs lib/hubspot/utils.rb in hubspot-ruby-0.1.5
- old
+ new
@@ -7,11 +7,12 @@
props.each{ |k,v| newprops[k] = v["value"] }
newprops
end
# Turns a hash into the hubspot properties format
- def hash_to_properties(hash)
- hash.map{ |k,v| {"property" => k.to_s, "value" => v}}
+ def hash_to_properties(hash, opts = {})
+ key_name = opts[:key_name] || "property"
+ hash.map{ |k,v| { key_name => k.to_s, "value" => v}}
end
# Generate the API URL for the request
#
# @param path [String] The path of the request with leading "/". Parts starting with a ":" will be interpolated