hubspot-api-ruby 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: caa1ed69670a9a924f8d1b1b44d3489ccce1e29a949495bfb6bec3e489f43525
4
- data.tar.gz: 6e8320b3f698d568c717661c3fb5b145505959d662f96ea02d63726cf3dff22a
3
+ metadata.gz: b3bfd2a58aeeda26ef22bb1cc16d7794397357e0b4584255c419e8f9e269cb94
4
+ data.tar.gz: 0f56e584031be6a59378c64d2922a09567c5632dbe3a67970fecf60f6c53a367
5
5
  SHA512:
6
- metadata.gz: f0e05b88efa2d452f512e6846d43eaf89408742412ff3c34161f6d21ca2b87d1431a74d5d4b20482580733e013d00f2455b17806ee02a559643115093a78e143
7
- data.tar.gz: 430cbd8c797d9aaf6a264d9116acd86f4a115c2bcfef12421ac6bbc988bdbf4cff6d5124b9f2a4355211b80450b8e80687d602c1aab159049964a7c690b956c6
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 gemspec.
4
- 2. Push updates to github.
5
- 3. Build gem with `gem build hubspot-api-ruby.gemspec`.
6
- 4. Push the resulting .gem file to Rubygems with `gem push`
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`
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "hubspot-api-ruby"
3
- s.version = "0.11.0"
3
+ s.version = "0.12.0"
4
4
  s.require_paths = ["lib"]
5
5
  s.authors = ["Jonathan"]
6
6
  s.email = ["jonathan@hoggo.com"]
@@ -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
- def id
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
- def metadata
89
- @metadata
90
- end
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.11.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-09-19 00:00:00.000000000 Z
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.1.2
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