class SimpleHubspot::Utils
Public Class Methods
hash_to_properties(hash, opts = {})
click to toggle source
# File lib/simple_hubspot/utils.rb, line 10 def hash_to_properties(hash, opts = {}) key_name = opts[:key_name] || "property" hash.map { |k, v| { key_name => k.to_s, "value" => v } } end
properties_to_hash(props)
click to toggle source
# File lib/simple_hubspot/utils.rb, line 4 def properties_to_hash(props) newprops = HashWithIndifferentAccess.new props.each { |k, v| newprops[k] = v["value"] } newprops end