Skip to content

Commit 4ae3e09

Browse files
authored
Remove all remaining estimates (#82)
* Remove all remaining estimates * Tweaks * Fix tech type in spec
1 parent 260a4fe commit 4ae3e09

30 files changed

+27
-4406
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [2.6.0] - 2025-11-07
9+
10+
- Removes create_mass_estimate and create_bitcoin_estimate method
11+
- Retires all remaining estimates functionalities
12+
813
## [2.5.0] - 2025-08-19
914

1015
### Removed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ gemspec
55
group :development, :test do
66
gem 'rake', '~> 13.0.1'
77
gem 'pry-byebug'
8-
gem 'rubocop', '~> 1.75.6'
8+
gem 'rubocop', '~> 0.66.0'
99
end

Gemfile.lock

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (2.5.0)
4+
patch_ruby (2.6.0)
55
typhoeus (~> 1.0, >= 1.0.1)
66

77
GEM
@@ -16,34 +16,34 @@ GEM
1616
byebug (11.1.3)
1717
coderay (1.1.3)
1818
concurrent-ruby (1.2.2)
19+
date (3.5.0)
1920
diff-lcs (1.4.4)
20-
ethon (0.16.0)
21+
ethon (0.15.0)
2122
ffi (>= 1.15.0)
2223
factory_bot (6.2.0)
2324
activesupport (>= 5.0.0)
2425
ffi (1.17.2)
2526
i18n (1.12.0)
2627
concurrent-ruby (~> 1.0)
27-
json (2.12.0)
28-
language_server-protocol (3.17.0.5)
29-
lint_roller (1.1.0)
28+
jaro_winkler (1.5.6)
3029
method_source (1.0.0)
3130
minitest (5.18.0)
3231
parallel (1.27.0)
33-
parser (3.3.8.0)
32+
parser (3.3.10.0)
3433
ast (~> 2.4.1)
3534
racc
36-
prism (1.4.0)
3735
pry (0.14.1)
3836
coderay (~> 1.1)
3937
method_source (~> 1.0)
4038
pry-byebug (3.8.0)
4139
byebug (~> 11.0)
4240
pry (~> 0.10)
41+
psych (5.2.6)
42+
date
43+
stringio
4344
racc (1.8.1)
4445
rainbow (3.1.1)
4546
rake (13.0.6)
46-
regexp_parser (2.10.0)
4747
rspec (3.10.0)
4848
rspec-core (~> 3.10.0)
4949
rspec-expectations (~> 3.10.0)
@@ -57,28 +57,21 @@ GEM
5757
diff-lcs (>= 1.2.0, < 2.0)
5858
rspec-support (~> 3.10.0)
5959
rspec-support (3.10.2)
60-
rubocop (1.75.6)
61-
json (~> 2.3)
62-
language_server-protocol (~> 3.17.0.2)
63-
lint_roller (~> 1.1.0)
60+
rubocop (0.66.0)
61+
jaro_winkler (~> 1.5.1)
6462
parallel (~> 1.10)
65-
parser (>= 3.3.0.2)
63+
parser (>= 2.5, != 2.5.1.1)
64+
psych (>= 3.1.0)
6665
rainbow (>= 2.2.2, < 4.0)
67-
regexp_parser (>= 2.9.3, < 3.0)
68-
rubocop-ast (>= 1.44.0, < 2.0)
6966
ruby-progressbar (~> 1.7)
70-
unicode-display_width (>= 2.4.0, < 4.0)
71-
rubocop-ast (1.44.1)
72-
parser (>= 3.3.7.2)
73-
prism (~> 1.4)
67+
unicode-display_width (>= 1.4.0, < 1.6)
7468
ruby-progressbar (1.13.0)
75-
typhoeus (1.4.1)
76-
ethon (>= 0.9.0)
69+
stringio (3.1.7)
70+
typhoeus (1.5.0)
71+
ethon (>= 0.9.0, < 0.16.0)
7772
tzinfo (2.0.6)
7873
concurrent-ruby (~> 1.0)
79-
unicode-display_width (3.1.4)
80-
unicode-emoji (~> 4.0, >= 4.0.4)
81-
unicode-emoji (4.0.4)
74+
unicode-display_width (1.5.0)
8275

8376
PLATFORMS
8477
arm64-darwin-20
@@ -96,7 +89,7 @@ DEPENDENCIES
9689
pry-byebug
9790
rake (~> 13.0.1)
9891
rspec (~> 3.6, >= 3.6.0)
99-
rubocop (~> 1.75.6)
92+
rubocop (~> 0.66.0)
10093

10194
BUNDLED WITH
10295
2.3.9

README.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -110,58 +110,6 @@ page = 1 # Pass in which page of orders you'd like
110110
Patch::Order.retrieve_orders(page: page)
111111
```
112112

113-
### Estimates
114-
115-
Estimates allow API users to get a quote for the cost of compensating a certain amount of CO2. When creating an estimate, an order in the `draft` state will also be created, reserving the allocation of a project for 5 minutes. If you don't place your draft order within those 5 minutes, the order will automatically be cancelled.
116-
117-
[API Reference](https://docs.patch.io/#/?id=estimates)
118-
119-
#### Examples
120-
121-
```ruby
122-
# Create a mass estimate
123-
mass = 1_000_000 # Pass in the mass in grams (i.e. 1 metric tonne)
124-
Patch::Estimate.create_mass_estimate(mass_g: mass)
125-
126-
# Create a vehicle estimate
127-
distance_m = 1_000_000 # Pass in the shipping distance in meters
128-
make = "Toyota" # Pass in the car make
129-
model = "Corolla" # Pass in the car model
130-
year = 2000 # Pass in the car year
131-
Patch::Estimate.create_vehicle_estimate(
132-
distance_m: distance_m,
133-
make: make,
134-
model: model,
135-
year: year
136-
)
137-
138-
# Create a Bitcoin estimate
139-
transaction_value_btc_sats = 1000; # [Optional] Pass in the transaction value in satoshis
140-
Patch::Estimate.create_bitcoin_estimate(transaction_value_btc_sats: transaction_value_btc_sats)
141-
142-
# Create an ecommerce estimate
143-
distance_m = 1_000_000 # Pass in the shipping distance in meters
144-
package_mass_g = 10_000 # Pass in the weight of the package shipped in grams
145-
transportation_method = "air" # Pass in the transportation method (air, rail, road, sea)
146-
Patch::Estimate.create_ecommerce_estimate(
147-
distance_m: distance_m,
148-
package_mass_g: package_mass_g,
149-
transportation_method: transportation_method
150-
)
151-
152-
## You can also specify a project-id field (optional) to be used instead of the preferred one
153-
project_id = 'pro_test_1234' # Pass in the project's ID
154-
Patch::Estimate.create_mass_estimate(mass_g: mass, project_id: project_id)
155-
156-
# Retrieve an estimate
157-
estimate_id = 'est_test_1234'
158-
Patch::Estimate.retrieve_estimate(estimate_id)
159-
160-
# Retrieve a list of estimates
161-
page = 1 # Pass in which page of estimates you'd like
162-
Patch::Estimate.retrieve_estimates(page: page)
163-
```
164-
165113
### Projects
166114

167115
Projects are the ways Patch takes CO2 out of the air. They can represent reforestation, enhanced weathering, direct air carbon capture, etc. When you place an order via Patch, it is allocated to a project.

lib/patch_ruby.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,13 @@
1717
require 'patch_ruby/configuration'
1818

1919
# Models
20-
require 'patch_ruby/models/create_air_shipping_estimate_request'
21-
require 'patch_ruby/models/create_bitcoin_estimate_request'
22-
require 'patch_ruby/models/create_mass_estimate_request'
2320
require 'patch_ruby/models/create_order_line_item_request'
2421
require 'patch_ruby/models/create_order_request'
25-
require 'patch_ruby/models/create_rail_shipping_estimate_request'
26-
require 'patch_ruby/models/create_road_shipping_estimate_request'
27-
require 'patch_ruby/models/create_sea_shipping_estimate_request'
2822
require 'patch_ruby/models/create_success_response'
2923
require 'patch_ruby/models/delete_order_line_item_response'
3024
require 'patch_ruby/models/delete_order_response'
3125
require 'patch_ruby/models/disclaimer'
3226
require 'patch_ruby/models/error_response'
33-
require 'patch_ruby/models/estimate'
34-
require 'patch_ruby/models/estimate_list_response'
35-
require 'patch_ruby/models/estimate_response'
3627
require 'patch_ruby/models/highlight'
3728
require 'patch_ruby/models/inventory'
3829
require 'patch_ruby/models/meta_index_object'
@@ -56,7 +47,6 @@
5647
require 'patch_ruby/models/update_order_line_item_request'
5748

5849
# APIs
59-
require 'patch_ruby/api/estimates_api'
6050
require 'patch_ruby/api/order_line_items_api'
6151
require 'patch_ruby/api/orders_api'
6252
require 'patch_ruby/api/projects_api'

0 commit comments

Comments
 (0)