lib/hubspot/properties.rb in hubspot-ruby-0.2.1 vs lib/hubspot/properties.rb in hubspot-ruby-0.3.0

- old
+ new

@@ -1,21 +1,25 @@ module Hubspot class Properties PROPERTY_SPECS = { group_field_names: %w(name displayName displayOrder properties), - field_names: %w(name groupName description fieldType formField type displayOrder label options), - valid_field_types: %w(textarea select text date file number radio checkbox), + field_names: %w(name groupName description fieldType formField type displayOrder label options showCurrencySymbol), + valid_field_types: %w(textarea select text date file number radio checkbox booleancheckbox), valid_types: %w(string number bool datetime enumeration), options: %w(description value label hidden displayOrder) } + DEFAULT_PROPERTY = 'email' class << self # TODO: properties can be set as configuration # TODO: find the way how to set a list of Properties + merge same property key if present from opts def add_default_parameters(opts={}) - properties = 'email' - opts.merge(property: properties) + if opts.keys.map(&:to_s).include? 'property' + opts + else + opts.merge(property: DEFAULT_PROPERTY) + end end def all(path, opts={}, filter={}) response = Hubspot::Connection.get_json(path, opts) filter_results(response, :groupName, filter[:include], filter[:exclude])