pricehubble 1.5.1 → 1.6.1
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/.github/workflows/test.yml +1 -1
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +25 -16
- data/Dockerfile +1 -1
- data/Gemfile +3 -3
- data/doc/assets/project.svg +7 -68
- data/gemfiles/rails_6.1.gemfile +3 -3
- data/gemfiles/rails_7.1.gemfile +3 -3
- data/lib/price_hubble/client/base.rb +1 -1
- data/lib/price_hubble/client/dossiers.rb +7 -7
- data/lib/price_hubble/client/utils/response.rb +2 -1
- data/lib/price_hubble/client/valuation.rb +5 -5
- data/lib/price_hubble/configuration_handling.rb +1 -1
- data/lib/price_hubble/core_ext/hash.rb +2 -2
- data/lib/price_hubble/entity/concern/associations.rb +9 -9
- data/lib/price_hubble/entity/concern/attributes/enum.rb +2 -2
- data/lib/price_hubble/entity/concern/attributes.rb +4 -3
- data/lib/price_hubble/identity.rb +1 -1
- data/lib/price_hubble/utils/bangers.rb +1 -1
- data/lib/price_hubble/version.rb +1 -1
- data/pricehubble.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e4560c6511f4825274bd9f0c8f0d992afbba0146124ef0bd3190a245cb9b034
|
4
|
+
data.tar.gz: 809942c34cc2b1bb219f91d0dae42b56454d34df87ed04684693c2dda40bab28
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f2cc01cce2b6dd5966eb73a656d1c4dc914259a5c1b147bfbe2c6fb22408863382b89f2a18fa6f8392ec26355587b928aecfae5a1503eece017d2a673f60ea1
|
7
|
+
data.tar.gz: d3b0f23dbff8ca220ca69f1c54aa091b6839f53129d4b0afa06c71188e5723730fe30137a76ee4b85a3ec087c2956fa7f5dacb56e0ac741bada2040f4b1470f1
|
data/.github/workflows/test.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
plugins:
|
2
2
|
- rubocop-rspec
|
3
3
|
- rubocop-rails
|
4
4
|
|
@@ -63,7 +63,7 @@ RSpec/NestedGroups:
|
|
63
63
|
Max: 4
|
64
64
|
|
65
65
|
# Disable regular Rails spec paths.
|
66
|
-
|
66
|
+
Rails/FilePath:
|
67
67
|
Enabled: false
|
68
68
|
|
69
69
|
# Because we just implemented the ActiveRecord API.
|
data/CHANGELOG.md
CHANGED
@@ -2,21 +2,30 @@
|
|
2
2
|
|
3
3
|
* TODO: Replace this bullet point with an actual description of a change.
|
4
4
|
|
5
|
+
### 1.6.1 (21 May 2025)
|
6
|
+
|
7
|
+
* Corrected some RuboCop glitches ([#15](https://github.com/hausgold/pricehubble/pull/15))
|
8
|
+
* Upgraded the rubocop dependencies ([#16](https://github.com/hausgold/pricehubble/pull/16))
|
9
|
+
|
10
|
+
### 1.6.0 (30 January 2025)
|
11
|
+
|
12
|
+
* Added all versions up to Ruby 3.4 to the CI matrix ([#14](https://github.com/hausgold/pricehubble/pull/14))
|
13
|
+
|
5
14
|
### 1.5.1 (17 January 2025)
|
6
15
|
|
7
|
-
* Added the logger dependency (#13)
|
16
|
+
* Added the logger dependency ([#13](https://github.com/hausgold/pricehubble/pull/13))
|
8
17
|
|
9
18
|
### 1.5.0 (12 January 2025)
|
10
19
|
|
11
|
-
* Switched to Zeitwerk as autoloader (#12)
|
20
|
+
* Switched to Zeitwerk as autoloader ([#12](https://github.com/hausgold/pricehubble/pull/12))
|
12
21
|
|
13
22
|
### 1.4.0 (3 January 2025)
|
14
23
|
|
15
|
-
* Raised minimum supported Ruby/Rails version to 2.7/6.1 (#11)
|
24
|
+
* Raised minimum supported Ruby/Rails version to 2.7/6.1 ([#11](https://github.com/hausgold/pricehubble/pull/11))
|
16
25
|
|
17
26
|
### 1.3.0 (4 October 2024)
|
18
27
|
|
19
|
-
* Upgraded the `recursive-open-struct` gem to `~> 2.0` (#10)
|
28
|
+
* Upgraded the `recursive-open-struct` gem to `~> 2.0` ([#10](https://github.com/hausgold/pricehubble/pull/10))
|
20
29
|
|
21
30
|
### 1.2.5 (15 August 2024)
|
22
31
|
|
@@ -36,12 +45,12 @@
|
|
36
45
|
|
37
46
|
### 1.2.1 (9 August 2024)
|
38
47
|
|
39
|
-
* Added API docs building to continuous integration (#9)
|
48
|
+
* Added API docs building to continuous integration ([#9](https://github.com/hausgold/pricehubble/pull/9))
|
40
49
|
|
41
50
|
### 1.2.0 (8 July 2024)
|
42
51
|
|
43
|
-
* Moved the development dependencies from the gemspec to the Gemfile (#7)
|
44
|
-
* Dropped support for Ruby <2.7 (#8)
|
52
|
+
* Moved the development dependencies from the gemspec to the Gemfile ([#7](https://github.com/hausgold/pricehubble/pull/7))
|
53
|
+
* Dropped support for Ruby <2.7 ([#8](https://github.com/hausgold/pricehubble/pull/8))
|
45
54
|
|
46
55
|
### 1.1.0 (24 February 2023)
|
47
56
|
|
@@ -49,14 +58,14 @@
|
|
49
58
|
|
50
59
|
### 1.0.0 (18 January 2023)
|
51
60
|
|
52
|
-
* Bundler >= 2.3 is from now on required as minimal version (#5)
|
53
|
-
* Dropped support for Ruby < 2.5 (#5)
|
54
|
-
* Dropped support for Rails < 5.2 (#5)
|
61
|
+
* Bundler >= 2.3 is from now on required as minimal version ([#5](https://github.com/hausgold/pricehubble/pull/5))
|
62
|
+
* Dropped support for Ruby < 2.5 ([#5](https://github.com/hausgold/pricehubble/pull/5))
|
63
|
+
* Dropped support for Rails < 5.2 ([#5](https://github.com/hausgold/pricehubble/pull/5))
|
55
64
|
* Updated all development/runtime gems to their latest
|
56
|
-
Ruby 2.5 compatible version (#5)
|
65
|
+
Ruby 2.5 compatible version ([#5](https://github.com/hausgold/pricehubble/pull/5))
|
57
66
|
* [Breaking Change] The `sanitize` argument of the
|
58
67
|
`PriceHubble::BaseEntity#attributes(sanitize = false)` method has changed to
|
59
|
-
a keyword argument `PriceHubble::BaseEntity#attributes(sanitize: false)` (#5)
|
68
|
+
a keyword argument `PriceHubble::BaseEntity#attributes(sanitize: false)` ([#5](https://github.com/hausgold/pricehubble/pull/5))
|
60
69
|
|
61
70
|
### 0.4.2 (15 October 2021)
|
62
71
|
|
@@ -70,13 +79,13 @@
|
|
70
79
|
|
71
80
|
### 0.4.0 (11 December 2020)
|
72
81
|
|
73
|
-
* Added initial dossier handling (create, delete, sharing link) (#3)
|
82
|
+
* Added initial dossier handling (create, delete, sharing link) ([#3](https://github.com/hausgold/pricehubble/pull/3))
|
74
83
|
|
75
84
|
### 0.3.0 (9 September 2020)
|
76
85
|
|
77
|
-
* Dropped support for Rails <5.2 (#2)
|
78
|
-
* Dropped support for Ruby <2.5 (#2)
|
79
|
-
* Updated the faraday gem spec to `~> 1.0` (#2)
|
86
|
+
* Dropped support for Rails <5.2 ([#2](https://github.com/hausgold/pricehubble/pull/2))
|
87
|
+
* Dropped support for Ruby <2.5 ([#2](https://github.com/hausgold/pricehubble/pull/2))
|
88
|
+
* Updated the faraday gem spec to `~> 1.0` ([#2](https://github.com/hausgold/pricehubble/pull/2))
|
80
89
|
|
81
90
|
### 0.2.0 (22 October 2019)
|
82
91
|
|
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
@@ -18,9 +18,9 @@ gem 'guard-rspec', '~> 4.7'
|
|
18
18
|
gem 'rake', '~> 13.0'
|
19
19
|
gem 'redcarpet', '~> 3.5'
|
20
20
|
gem 'rspec', '~> 3.12'
|
21
|
-
gem 'rubocop'
|
22
|
-
gem 'rubocop-rails'
|
23
|
-
gem 'rubocop-rspec'
|
21
|
+
gem 'rubocop'
|
22
|
+
gem 'rubocop-rails'
|
23
|
+
gem 'rubocop-rspec'
|
24
24
|
gem 'simplecov', '>= 0.22'
|
25
25
|
gem 'terminal-table', '~> 3.0'
|
26
26
|
gem 'timecop', '>= 0.9.6'
|
data/doc/assets/project.svg
CHANGED
@@ -1,68 +1,7 @@
|
|
1
|
-
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
version="1.1"
|
9
|
-
id="Ebene_1"
|
10
|
-
x="0px"
|
11
|
-
y="0px"
|
12
|
-
viewBox="0 0 800 200"
|
13
|
-
xml:space="preserve"
|
14
|
-
width="800"
|
15
|
-
height="200"><metadata
|
16
|
-
id="metadata33"><rdf:RDF><cc:Work
|
17
|
-
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
18
|
-
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
19
|
-
id="defs31" />
|
20
|
-
<style
|
21
|
-
type="text/css"
|
22
|
-
id="style2">
|
23
|
-
.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#E73E11;}
|
24
|
-
.st1{fill-rule:evenodd;clip-rule:evenodd;fill:#0371B9;}
|
25
|
-
.st2{fill:#132E48;}
|
26
|
-
.st3{font-family:'OpenSans-Bold';}
|
27
|
-
.st4{font-size:29.5168px;}
|
28
|
-
.st5{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
|
29
|
-
.st6{opacity:0.5;fill:#132E48;}
|
30
|
-
.st7{font-family:'OpenSans';}
|
31
|
-
.st8{font-size:12px;}
|
32
|
-
</style>
|
33
|
-
<g
|
34
|
-
transform="translate(0,1.53584)"
|
35
|
-
id="g828"><g
|
36
|
-
transform="translate(35.93985,35.66416)"
|
37
|
-
id="g8">
|
38
|
-
<path
|
39
|
-
style="clip-rule:evenodd;fill:#e73e11;fill-rule:evenodd"
|
40
|
-
id="path4"
|
41
|
-
d="m -0.1,124.4 c 0,0 33.7,-123.2 66.7,-123.2 12.8,0 26.9,21.9 38.8,47.2 -23.6,27.9 -66.6,59.7 -94,76 -7.1,0 -11.5,0 -11.5,0 z"
|
42
|
-
class="st0" />
|
43
|
-
<path
|
44
|
-
style="clip-rule:evenodd;fill:#0371b9;fill-rule:evenodd"
|
45
|
-
id="path6"
|
46
|
-
d="m 88.1,101.8 c 13.5,-10.4 18.4,-16.2 27.1,-25.4 10,25.7 16.7,48 16.7,48 0,0 -41.4,0 -78,0 14.6,-7.9 18.7,-10.7 34.2,-22.6 z"
|
47
|
-
class="st1" />
|
48
|
-
</g><text
|
49
|
-
y="106.40316"
|
50
|
-
x="192.43155"
|
51
|
-
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:29.51733398px;font-family:'Open Sans', sans-serif;-inkscape-font-specification:'OpenSans-Bold, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#132e48"
|
52
|
-
id="text10"
|
53
|
-
class="st2 st3 st4">PriceHubble</text>
|
54
|
-
<rect
|
55
|
-
style="clip-rule:evenodd;fill:none;fill-rule:evenodd"
|
56
|
-
id="rect12"
|
57
|
-
height="24"
|
58
|
-
width="314.5"
|
59
|
-
class="st5"
|
60
|
-
y="118.06416"
|
61
|
-
x="194.23985" /><text
|
62
|
-
y="127.22146"
|
63
|
-
x="194.21715"
|
64
|
-
style="font-size:12px;font-family:'Open Sans', sans-serif;opacity:0.5;fill:#132e48;-inkscape-font-specification:'Open Sans, sans-serif, Normal';font-weight:normal;font-style:normal;font-stretch:normal;font-variant:normal;text-anchor:start;text-align:start;writing-mode:lr;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;"
|
65
|
-
id="text14"
|
66
|
-
class="st6 st7 st8">Ruby client for the PriceHubble REST API</text>
|
67
|
-
</g>
|
68
|
-
</svg>
|
1
|
+
<svg id="hg-readme-banner-v2" viewBox="0 0 800 200" width="800" height="200" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="a" x1="112.46" y1="309.13" x2="314.5" y2="309.13" gradientUnits="userSpaceOnUse" gradientTransform="translate(-33.985 -122.816)"><stop offset="0" stop-color="#1992f4" /><stop offset="1" stop-color="#2b8af6" /></linearGradient></defs><style>.st3{font-family:'OpenSans-Bold'}.st4{font-size:29.5168px}.st5{fill-rule:evenodd;clip-rule:evenodd;fill:none}.st7{font-family:'OpenSans'}.st8{font-size:12px}@media (prefers-color-scheme:dark){text{fill:#f0f6fc!important}}</style>
|
2
|
+
<text y="107.939" x="192.432" style="font-family:'Open Sans', sans-serif;-inkscape-font-specification:'OpenSans-Bold, Bold';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start" class="st3 st4" font-weight="700" font-size="29.517" font-family="'Open Sans',sans-serif" fill="#3f3e4b"
|
3
|
+
>PriceHubble</text>
|
4
|
+
<path class="st5" clip-rule="evenodd" fill="none" fill-rule="evenodd" d="M194.24 119.6h314.5v24h-314.5z"/>
|
5
|
+
<text y="128.757" x="194.217" style="font-family:'Open Sans', sans-serif;-inkscape-font-specification:'Open Sans, sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:start" class="st7 st8" font-weight="400" font-size="12" font-family="'Open Sans',sans-serif" opacity=".75" fill="#3f3e4b"
|
6
|
+
>Ruby client for the PriceHubble REST API</text>
|
7
|
+
<g transform="translate(33.985 122.816)"><path d="M129.427 32.4q-7-20.71-14.09-41.44c-.33-1-.52-1.18-1.34-.25-3.1 3.48-6.25 6.92-9.49 10.26a180.23 180.23 0 0 1-18.54 16.15 193.7 193.7 0 0 1-21.95 15.43c-2.53 1.47-5.08 2.91-7.62 4.36l.11.27h73.05c1 .1 1.4-.13 1-1.22-.4-1.09-.73-2.38-1.13-3.56z" fill="url(#a)" /><path d="M89.077-63.87c-3.57-5.58-7.42-10.95-12.62-15.17-3.93-3.19-8.28-5-13.42-3.32a23 23 0 0 0-8.76 5.6 66.77 66.77 0 0 0-10.34 13.09c-8 12.68-14.06 26.28-19.28 40.25-4.6 12.33-8.82 24.8-12.95 37.29-2.45 7.41-4.39 15-6.61 22.49-.26.88 0 1 .79 1h7.4c1.23 0 2.44.14 3.6-.68 9.17-6.45 18.51-12.67 27.55-19.31a396.21 396.21 0 0 0 37.36-31.3 245.79 245.79 0 0 0 20.74-22 1.6 1.6 0 0 0 .26-2 224.45 224.45 0 0 0-13.72-25.94z" fill="#f2686d" /></g></svg>
|
data/gemfiles/rails_6.1.gemfile
CHANGED
@@ -10,9 +10,9 @@ gem "guard-rspec", "~> 4.7"
|
|
10
10
|
gem "rake", "~> 13.0"
|
11
11
|
gem "redcarpet", "~> 3.5"
|
12
12
|
gem "rspec", "~> 3.12"
|
13
|
-
gem "rubocop"
|
14
|
-
gem "rubocop-rails"
|
15
|
-
gem "rubocop-rspec"
|
13
|
+
gem "rubocop"
|
14
|
+
gem "rubocop-rails"
|
15
|
+
gem "rubocop-rspec"
|
16
16
|
gem "simplecov", ">= 0.22"
|
17
17
|
gem "terminal-table", "~> 3.0"
|
18
18
|
gem "timecop", ">= 0.9.6"
|
data/gemfiles/rails_7.1.gemfile
CHANGED
@@ -10,9 +10,9 @@ gem "guard-rspec", "~> 4.7"
|
|
10
10
|
gem "rake", "~> 13.0"
|
11
11
|
gem "redcarpet", "~> 3.5"
|
12
12
|
gem "rspec", "~> 3.12"
|
13
|
-
gem "rubocop"
|
14
|
-
gem "rubocop-rails"
|
15
|
-
gem "rubocop-rspec"
|
13
|
+
gem "rubocop"
|
14
|
+
gem "rubocop-rails"
|
15
|
+
gem "rubocop-rspec"
|
16
16
|
gem "simplecov", ">= 0.22"
|
17
17
|
gem "terminal-table", "~> 3.0"
|
18
18
|
gem "timecop", ">= 0.9.6"
|
@@ -24,7 +24,7 @@ module PriceHubble
|
|
24
24
|
#
|
25
25
|
# @param con [Faraday::Connection] the connection object
|
26
26
|
#
|
27
|
-
# rubocop:disable Metrics/MethodLength because of the middleware list
|
27
|
+
# rubocop:disable Metrics/MethodLength -- because of the middleware list
|
28
28
|
def configure(con)
|
29
29
|
con.use :instrumentation
|
30
30
|
|
@@ -11,8 +11,8 @@ module PriceHubble
|
|
11
11
|
# @return [PriceHubble::Dossier, nil] the PriceHubble dossier,
|
12
12
|
# or +nil+ on error
|
13
13
|
#
|
14
|
-
# rubocop:disable Metrics/MethodLength because thats the bare minimum
|
15
|
-
#
|
14
|
+
# rubocop:disable Metrics/MethodLength -- because thats the bare minimum
|
15
|
+
# handling is quite complex
|
16
16
|
def create_dossier(entity, **args)
|
17
17
|
res = connection.post do |req|
|
18
18
|
req.path = '/api/v1/dossiers'
|
@@ -36,9 +36,9 @@ module PriceHubble
|
|
36
36
|
# @param locale [String] the user frontend locale
|
37
37
|
# @param args [Hash{Symbol => Mixed}] additional arguments
|
38
38
|
#
|
39
|
-
# rubocop:disable Metrics/MethodLength because thats the bare minimum
|
40
|
-
# rubocop:disable Metrics/AbcSize because the decission
|
41
|
-
#
|
39
|
+
# rubocop:disable Metrics/MethodLength -- because thats the bare minimum
|
40
|
+
# rubocop:disable Metrics/AbcSize -- because the decission handling is
|
41
|
+
# quite complex
|
42
42
|
def share_dossier(entity, ttl:, locale:, **args)
|
43
43
|
res = connection.post do |req|
|
44
44
|
req.path = '/api/v1/dossiers/links'
|
@@ -65,8 +65,8 @@ module PriceHubble
|
|
65
65
|
# @param entity [PriceHubble::Dossier] the entity to delete
|
66
66
|
# @param args [Hash{Symbol => Mixed}] additional arguments
|
67
67
|
#
|
68
|
-
# rubocop:disable Metrics/MethodLength because thats the bare
|
69
|
-
#
|
68
|
+
# rubocop:disable Metrics/MethodLength -- because thats the bare
|
69
|
+
# minimumbecause the decission handling is quite complex
|
70
70
|
def delete_dossier(entity, **args)
|
71
71
|
res = connection.delete do |req|
|
72
72
|
req.path = "/api/v1/dossiers/#{entity.id}"
|
@@ -5,7 +5,8 @@ module PriceHubble
|
|
5
5
|
module Utils
|
6
6
|
# Some helpers to work with responses in a general way.
|
7
7
|
#
|
8
|
-
# rubocop:disable Metrics/BlockLength because of
|
8
|
+
# rubocop:disable Metrics/BlockLength -- because of
|
9
|
+
# ActiveSupport::Concern
|
9
10
|
module Response
|
10
11
|
extend ActiveSupport::Concern
|
11
12
|
|
@@ -11,8 +11,8 @@ module PriceHubble
|
|
11
11
|
# @return [Array<PriceHubble::Valuation>, nil] the valuation results,
|
12
12
|
# or +nil+ on error
|
13
13
|
#
|
14
|
-
# rubocop:disable Metrics/MethodLength because of the request handling
|
15
|
-
# rubocop:disable Metrics/AbcSize
|
14
|
+
# rubocop:disable Metrics/MethodLength -- because of the request handling
|
15
|
+
# rubocop:disable Metrics/AbcSize -- ditto
|
16
16
|
def property_value(request, **args)
|
17
17
|
data = request.attributes(sanitize: true)
|
18
18
|
res = connection.post do |req|
|
@@ -42,9 +42,9 @@ module PriceHubble
|
|
42
42
|
# @param request [PriceHubble::ValuationRequest] the original request
|
43
43
|
# @return [Proc] the valuation mapping code
|
44
44
|
#
|
45
|
-
# rubocop:disable Metrics/MethodLength because of the request
|
46
|
-
#
|
47
|
-
# rubocop:disable Metrics/AbcSize
|
45
|
+
# rubocop:disable Metrics/MethodLength -- because of the request to
|
46
|
+
# response mapping
|
47
|
+
# rubocop:disable Metrics/AbcSize -- ditto
|
48
48
|
def assign_valuations(data, request)
|
49
49
|
lambda do
|
50
50
|
# valuations[i][j] contains the valuation for property i on date j
|
@@ -33,8 +33,8 @@ class Hash
|
|
33
33
|
# @param object [Mixed] the object to compact
|
34
34
|
# @return [Mixed] the compacted object
|
35
35
|
#
|
36
|
-
# rubocop:disable Metrics/MethodLength because of the extra empty
|
37
|
-
#
|
36
|
+
# rubocop:disable Metrics/MethodLength -- because of the extra empty hash
|
37
|
+
# compaction logic
|
38
38
|
def deep_compact_in_object(object)
|
39
39
|
case object
|
40
40
|
when Hash
|
@@ -38,8 +38,8 @@ module PriceHubble
|
|
38
38
|
# @return [Array<RecursiveOpenStruct, Hash{Symbol => Mixed}>] the
|
39
39
|
# left over data
|
40
40
|
#
|
41
|
-
# rubocop:disable Metrics/AbcSize because of the complex logic
|
42
|
-
# rubocop:disable Metrics/MethodLength because of the complex logic
|
41
|
+
# rubocop:disable Metrics/AbcSize -- because of the complex logic
|
42
|
+
# rubocop:disable Metrics/MethodLength -- because of the complex logic
|
43
43
|
def map_has_one_association(attribute, opts, struct, hash)
|
44
44
|
# Early exit when the source key is missing on the given data
|
45
45
|
key = opts[:from]
|
@@ -77,12 +77,12 @@ module PriceHubble
|
|
77
77
|
# @return [Array<RecursiveOpenStruct, Hash{Symbol => Mixed}>] the
|
78
78
|
# left over data
|
79
79
|
#
|
80
|
-
# rubocop:disable Metrics/AbcSize because of the complex logic
|
81
|
-
# rubocop:disable Metrics/CyclomaticComplexity because of the
|
80
|
+
# rubocop:disable Metrics/AbcSize -- because of the complex logic
|
81
|
+
# rubocop:disable Metrics/CyclomaticComplexity -- because of the
|
82
82
|
# complex logic
|
83
|
-
# rubocop:disable Metrics/PerceivedComplexity because of the
|
84
|
-
#
|
85
|
-
# rubocop:disable Metrics/MethodLength because of the complex logic
|
83
|
+
# rubocop:disable Metrics/PerceivedComplexity -- because of the complex
|
84
|
+
# logic
|
85
|
+
# rubocop:disable Metrics/MethodLength -- because of the complex logic
|
86
86
|
def map_has_many_association(attribute, opts, struct, hash)
|
87
87
|
# Early exit when the source key is missing on the given data
|
88
88
|
key = opts[:from]
|
@@ -120,8 +120,8 @@ module PriceHubble
|
|
120
120
|
# rubocop:enable Metrics/MethodLength
|
121
121
|
end
|
122
122
|
|
123
|
-
# rubocop:disable Naming/PredicateName because we follow
|
124
|
-
#
|
123
|
+
# rubocop:disable Naming/PredicateName -- because we follow known naming
|
124
|
+
# conventions
|
125
125
|
class_methods do
|
126
126
|
# Initialize the associations structures on an inherited class.
|
127
127
|
#
|
@@ -14,8 +14,8 @@ module PriceHubble
|
|
14
14
|
# @param values [Array<String, Symbol>] the allowed values
|
15
15
|
# @param _args [Hash{Symbol => Mixed}] additional options
|
16
16
|
#
|
17
|
-
# rubocop:disable Metrics/MethodLength because of the inline
|
18
|
-
#
|
17
|
+
# rubocop:disable Metrics/MethodLength -- because of the inline meta
|
18
|
+
# method definitions
|
19
19
|
def typed_attr_enum(name, values:, **_args)
|
20
20
|
values = values.map(&:to_sym)
|
21
21
|
const_values = "ATTR_#{name.to_s.upcase}"
|
@@ -25,8 +25,8 @@ module PriceHubble
|
|
25
25
|
# @param sanitize [Boolean] whenever to sanitize the data for transport
|
26
26
|
# @return [Hash{String => Mixed}] the attribute data
|
27
27
|
#
|
28
|
-
# rubocop:disable Metrics/MethodLength because of the
|
29
|
-
#
|
28
|
+
# rubocop:disable Metrics/MethodLength -- because of the key/value
|
29
|
+
# sanitization handling
|
30
30
|
def attributes(sanitize: false)
|
31
31
|
attribute_names.each_with_object({}) do |key, memo|
|
32
32
|
reader = key
|
@@ -74,7 +74,8 @@ module PriceHubble
|
|
74
74
|
# @param sanitize [Boolean] whenever to sanitize the data for transport
|
75
75
|
# @return [Mixed] the attribute(s) data
|
76
76
|
#
|
77
|
-
# rubocop:disable Metrics/MethodLength because thats the pure
|
77
|
+
# rubocop:disable Metrics/MethodLength -- because thats the pure
|
78
|
+
# minimum
|
78
79
|
def resolve_attributes(obj, sanitize: false)
|
79
80
|
if obj.respond_to? :attributes
|
80
81
|
obj = if obj.method(:attributes).arity == 1
|
@@ -15,7 +15,7 @@ module PriceHubble
|
|
15
15
|
# @raise [NoMethodError] when a source method is not defined
|
16
16
|
# @raise [ArgumentError] when a source method does not accept arguments
|
17
17
|
#
|
18
|
-
# rubocop:disable Metrics/MethodLength because the method template
|
18
|
+
# rubocop:disable Metrics/MethodLength -- because the method template
|
19
19
|
# is better inlined
|
20
20
|
def bangers(*methods)
|
21
21
|
methods.each do |meth|
|
data/lib/price_hubble/version.rb
CHANGED
data/pricehubble.gemspec
CHANGED
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.add_dependency 'activesupport', '>= 6.1'
|
38
38
|
spec.add_dependency 'faraday', '~> 1.0'
|
39
39
|
spec.add_dependency 'faraday_middleware', '~> 1.0'
|
40
|
+
spec.add_dependency 'mutex_m', '~> 0.3.0'
|
40
41
|
spec.add_dependency 'recursive-open-struct', '~> 2.0'
|
41
42
|
spec.add_dependency 'zeitwerk', '~> 2.6'
|
42
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pricehubble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hermann Mayer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: mutex_m
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.3.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.3.0
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: recursive-open-struct
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
209
223
|
- !ruby/object:Gem::Version
|
210
224
|
version: '0'
|
211
225
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
226
|
+
rubygems_version: 3.4.22
|
213
227
|
signing_key:
|
214
228
|
specification_version: 4
|
215
229
|
summary: Ruby client for the PriceHubble REST API
|