ruby_hubspot_api 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4214bf31fd3e4041ac3c10fd4ea0faef5a1576423f79353a42fbfea0b9a11f11
4
- data.tar.gz: 960b116fc8da2c78d430c6e813ad77023c1ac3088f3a8239291ea7400f67c6d2
3
+ metadata.gz: 05532440bdcacffba3a53b549a863f9f5ff651df0623f78e0d386de48a637c25
4
+ data.tar.gz: 7e11d3872e45db1c46353ab28377246fbd3b3559b1257ea56b9bb98d6583c822
5
5
  SHA512:
6
- metadata.gz: 681a2908baea00ce5c4ff396f85442f90d4c760cca8560106f259628e49b00fc5d61901f6ac44cf3864a78f3f58af26fcf4d38f423a10eda065e570e0f741f7d
7
- data.tar.gz: d94bb5b7cd68317293ffe312e92fd1d4a352c215fdda61f251827b858d80924d716f99edafac09b628ad344b37654c1c477de146f6cc36bd7e6883005be22c34
6
+ metadata.gz: 0f3c88cc59ee0940ef863bdaebf53ea789aa0e3e1338b5529a2973ce2e454e8b9b8c82111de71123c6d12f8a6268e48f8de049c3dcd369b0e1834d824b86f136
7
+ data.tar.gz: 87d904150778d77e4c73abd0906646c776438a7944b7e7f1e89e9af5f8454ac455df018f2ae4f39746ceeabf23acf50d47c3e538abe2bb1770b316000f103ef4
data/CHANGELOG.md CHANGED
@@ -1,4 +1,5 @@
1
- ## v0.1.0
1
+
2
+ ## v0.1.1
2
3
 
3
4
  - initial setup
4
5
  - Setup the configuration block
@@ -41,3 +42,13 @@
41
42
  - Test that we only get the properties we ask for or the defaults
42
43
  - Flatten the properties array into a comma separated list
43
44
  - Improve the intialiser
45
+ - Update the changeling and link in gem spec
46
+ - adds the version numbers to the gemspec
47
+ - Fix dependencies
48
+ - bump version
49
+
50
+ ## v0.1.0
51
+
52
+ - adds the version numbers to the gemspec
53
+ - Fix dependencies
54
+ - bump version
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby_hubspot_api (0.1.0)
4
+ ruby_hubspot_api (0.1.1)
5
5
  bundler (>= 2.0)
6
6
  dotenv (>= 2.0)
7
7
  httparty (>= 0.1, < 1.0)
data/README.md CHANGED
@@ -137,14 +137,14 @@ contacts.each do |contact|
137
137
  end
138
138
 
139
139
  # Search for companies with number of employees greater than or equal to 100
140
- companies = Hubspot::Company.search(number_of_employees_gte: 100)
140
+ companies = Hubspot::Company.search(query: { number_of_employees_gte: 100 })
141
141
 
142
142
  companies.each do |company|
143
143
  puts "Found: #{company.name}, Employees: #{company.number_of_employees}"
144
144
  end
145
145
 
146
146
  # Search for contacts with email in a specific list (IN operator)
147
- contacts = Hubspot::Contact.search(email_in: ['user1@example.com', 'user2@example.com'])
147
+ contacts = Hubspot::Contact.search(query: { email_in: ['user1@example.com', 'user2@example.com'] })
148
148
 
149
149
  contacts.each do |contact|
150
150
  puts "Found: #{contact.email}"
@@ -134,12 +134,10 @@ module Hubspot
134
134
  filter_groups = [{ filters: [] }]
135
135
 
136
136
  filters.each do |key, value|
137
- property_name, operator = extract_property_and_operator(key)
138
- filter_groups.first[:filters] << {
139
- propertyName: property_name,
140
- operator: operator,
141
- value: value
142
- }
137
+ filter = extract_property_and_operator(key)
138
+ value_key = value.is_a?(Array) ? :values : :value
139
+ filter[value_key] = value
140
+ filter_groups.first[:filters] << filter
143
141
  end
144
142
 
145
143
  filter_groups
@@ -148,11 +146,16 @@ module Hubspot
148
146
  # Extract property name and operator from the key
149
147
  def extract_property_and_operator(key)
150
148
  OPERATOR_MAP.each do |suffix, hubspot_operator|
151
- return [key.to_s.sub(suffix, ''), hubspot_operator] if key.to_s.end_with?(suffix)
149
+ if key.to_s.end_with?(suffix)
150
+ return {
151
+ propertyName: key.to_s.sub(suffix, ''),
152
+ operator: hubspot_operator
153
+ }
154
+ end
152
155
  end
153
156
 
154
157
  # Default to 'EQ' operator if no suffix is found
155
- [key.to_s, 'EQ']
158
+ { propertyName: key.to_s, operator: 'EQ' }
156
159
  end
157
160
  end
158
161
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hubspot
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_hubspot_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Brook
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-24 00:00:00.000000000 Z
11
+ date: 2024-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake