hubspot-api-ruby 0.11.0 → 0.12.0
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/RELEASING.md +5 -4
- data/hubspot-api-ruby.gemspec +1 -1
- data/lib/hubspot/resource.rb +4 -15
- data/spec/lib/hubspot/resource_spec.rb +20 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3bfd2a58aeeda26ef22bb1cc16d7794397357e0b4584255c419e8f9e269cb94
|
4
|
+
data.tar.gz: 0f56e584031be6a59378c64d2922a09567c5632dbe3a67970fecf60f6c53a367
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cd0a53353924b64a5e1f6a2aca63991e9e5aff111c4e91570090ef0061058aed825d9fb9bdf29d2d9239375872d44d229b540c63a8c71e6f1893b74e3e01fba
|
7
|
+
data.tar.gz: 36b861191b970ee112f72e21624b0827d33f1ff1912924f153267c7cafd5867cf949dd3b3c44c92d077d555c419830db1e30664be6f5faabb7b0c0aaca15c973
|
data/RELEASING.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Releasing to Rubygems
|
2
2
|
|
3
|
-
1. Update
|
4
|
-
2.
|
5
|
-
3.
|
6
|
-
4.
|
3
|
+
1. Update History.md
|
4
|
+
2. Update gemspec.
|
5
|
+
3. Push updates to github.
|
6
|
+
4. Build gem with `gem build hubspot-api-ruby.gemspec`.
|
7
|
+
5. Push the resulting .gem file to Rubygems with `gem push`
|
data/hubspot-api-ruby.gemspec
CHANGED
data/lib/hubspot/resource.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
module Hubspot
|
2
2
|
class Resource
|
3
|
-
|
4
3
|
class_attribute :id_field, instance_writer: false
|
5
4
|
class_attribute :property_name_field, instance_writer: false
|
6
5
|
class_attribute :update_method, instance_writer: false
|
@@ -73,25 +72,15 @@ module Hubspot
|
|
73
72
|
@deleted = false
|
74
73
|
end
|
75
74
|
|
76
|
-
|
77
|
-
@id
|
78
|
-
end
|
79
|
-
|
80
|
-
def id=(id)
|
81
|
-
@id = id
|
82
|
-
end
|
75
|
+
attr_accessor :id
|
83
76
|
|
84
77
|
def to_i
|
85
78
|
@id
|
86
79
|
end
|
87
80
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
def changes
|
93
|
-
@changes
|
94
|
-
end
|
81
|
+
attr_reader :changes
|
82
|
+
attr_reader :metadata
|
83
|
+
attr_reader :properties
|
95
84
|
|
96
85
|
def changed?
|
97
86
|
!@changes.empty?
|
@@ -91,4 +91,24 @@ RSpec.describe Hubspot::Resource do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
94
|
+
|
95
|
+
describe '#properties' do
|
96
|
+
context 'using new' do
|
97
|
+
subject(:resource) { described_class.new(properties) }
|
98
|
+
let(:properties) { { id: 1, firstname: 'John', lastname: 'Wayne' } }
|
99
|
+
|
100
|
+
it 'has no properties' do
|
101
|
+
expect(subject.properties).to be_empty
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'using from_result' do
|
106
|
+
subject(:resource) { described_class.from_result({ properties: properties }) }
|
107
|
+
let(:properties) { { id: { 'value' => 1 }, firstname: { 'value' => 'John' }, lastname: { 'value' => 'Wayne' } } }
|
108
|
+
|
109
|
+
it 'has properties' do
|
110
|
+
expect(subject.properties).to eq HashWithIndifferentAccess.new(properties)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
94
114
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hubspot-api-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -346,7 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
346
346
|
- !ruby/object:Gem::Version
|
347
347
|
version: '0'
|
348
348
|
requirements: []
|
349
|
-
rubygems_version: 3.
|
349
|
+
rubygems_version: 3.2.33
|
350
350
|
signing_key:
|
351
351
|
specification_version: 4
|
352
352
|
summary: hubspot-api-ruby is a wrapper for the HubSpot REST API
|