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 +4 -4
- data/CHANGELOG.md +12 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/hubspot/resource.rb +11 -8
- data/lib/hubspot/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05532440bdcacffba3a53b549a863f9f5ff651df0623f78e0d386de48a637c25
|
4
|
+
data.tar.gz: 7e11d3872e45db1c46353ab28377246fbd3b3559b1257ea56b9bb98d6583c822
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f3c88cc59ee0940ef863bdaebf53ea789aa0e3e1338b5529a2973ce2e454e8b9b8c82111de71123c6d12f8a6268e48f8de049c3dcd369b0e1834d824b86f136
|
7
|
+
data.tar.gz: 87d904150778d77e4c73abd0906646c776438a7944b7e7f1e89e9af5f8454ac455df018f2ae4f39746ceeabf23acf50d47c3e538abe2bb1770b316000f103ef4
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
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
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}"
|
data/lib/hubspot/resource.rb
CHANGED
@@ -134,12 +134,10 @@ module Hubspot
|
|
134
134
|
filter_groups = [{ filters: [] }]
|
135
135
|
|
136
136
|
filters.each do |key, value|
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
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
|
-
|
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
|
-
|
158
|
+
{ propertyName: key.to_s, operator: 'EQ' }
|
156
159
|
end
|
157
160
|
end
|
158
161
|
|
data/lib/hubspot/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|