Skip to content

Commit c16361a

Browse files
committed
Rename PatchRuby to Patch
1 parent e8c96c4 commit c16361a

37 files changed

+134
-134
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ After installing the gem, you'll have to configure it with your API key which is
3333
```ruby
3434
require 'patch_ruby'
3535

36-
PatchRuby.configure do |config|
36+
Patch.configure do |config|
3737
# Configure the Patch gem with your API key here
3838
config.access_token = 'key_test_1234'
3939
end
@@ -42,7 +42,7 @@ end
4242
Once configured, you can test it out:
4343
```ruby
4444
# Retrieve and print all your orders
45-
orders_api = PatchRuby::OrdersApi.new
45+
orders_api = Patch::OrdersApi.new
4646

4747
begin
4848
orders_response = orders_api.retrieve_orders
@@ -51,7 +51,7 @@ begin
5151
puts "Order ID: #{order.id}, Order State: #{order.state}"
5252
end
5353
# Rescue from any Patch API errors
54-
rescue PatchRuby::ApiError => e
54+
rescue Patch::ApiError => e
5555
puts "Failed to retrieve Orders with status code #{e.code}: #{e.message}"
5656
end
5757
```

lib/patch_ruby.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
require 'patch_ruby/api/preferences_api'
3535
require 'patch_ruby/api/projects_api'
3636

37-
module PatchRuby
37+
module Patch
3838
class << self
3939
# Customize default settings for the SDK using block.
40-
# PatchRuby.configure do |config|
40+
# Patch.configure do |config|
4141
# config.username = "xxx"
4242
# config.password = "xxx"
4343
# end

lib/patch_ruby/api/orders_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'cgi'
1414

15-
module PatchRuby
15+
module Patch
1616
class OrdersApi
1717
attr_accessor :api_client
1818

lib/patch_ruby/api/preferences_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'cgi'
1414

15-
module PatchRuby
15+
module Patch
1616
class PreferencesApi
1717
attr_accessor :api_client
1818

lib/patch_ruby/api/projects_api.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'cgi'
1414

15-
module PatchRuby
15+
module Patch
1616
class ProjectsApi
1717
attr_accessor :api_client
1818

lib/patch_ruby/api_client.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
require 'tempfile'
1717
require 'typhoeus'
1818

19-
module PatchRuby
19+
module Patch
2020
class ApiClient
2121
# The Configuration object holding settings to be used in the API client.
2222
attr_accessor :config
@@ -237,7 +237,7 @@ def convert_to_type(data, return_type)
237237
end
238238
else
239239
# models, e.g. Pet
240-
PatchRuby.const_get(return_type).build_from_hash(data)
240+
Patch.const_get(return_type).build_from_hash(data)
241241
end
242242
end
243243

lib/patch_ruby/api_error.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
=end
1212

13-
module PatchRuby
13+
module Patch
1414
class ApiError < StandardError
1515
attr_reader :code, :response_headers, :response_body
1616

lib/patch_ruby/configuration.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
=end
1212

13-
module PatchRuby
13+
module Patch
1414
class Configuration
1515
# Defines url scheme
1616
attr_accessor :scheme

lib/patch_ruby/models/allocation.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class Allocation
1717
attr_accessor :id
1818

@@ -48,13 +48,13 @@ def self.openapi_nullable
4848
# @param [Hash] attributes Model attributes in the form of hash
4949
def initialize(attributes = {})
5050
if (!attributes.is_a?(Hash))
51-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::Allocation` initialize method"
51+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::Allocation` initialize method"
5252
end
5353

5454
# check to see if the attribute exists and convert string to symbol for hash key
5555
attributes = attributes.each_with_object({}) { |(k, v), h|
5656
if (!self.class.attribute_map.key?(k.to_sym))
57-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::Allocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::Allocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5858
end
5959
h[k.to_sym] = v
6060
}
@@ -171,7 +171,7 @@ def _deserialize(type, value)
171171
end
172172
end
173173
else # model
174-
PatchRuby.const_get(type).build_from_hash(value)
174+
Patch.const_get(type).build_from_hash(value)
175175
end
176176
end
177177

lib/patch_ruby/models/error_response.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class ErrorResponse
1717
attr_accessor :success
1818

@@ -49,13 +49,13 @@ def self.openapi_nullable
4949
# @param [Hash] attributes Model attributes in the form of hash
5050
def initialize(attributes = {})
5151
if (!attributes.is_a?(Hash))
52-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::ErrorResponse` initialize method"
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::ErrorResponse` initialize method"
5353
end
5454

5555
# check to see if the attribute exists and convert string to symbol for hash key
5656
attributes = attributes.each_with_object({}) { |(k, v), h|
5757
if (!self.class.attribute_map.key?(k.to_sym))
58-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5959
end
6060
h[k.to_sym] = v
6161
}
@@ -172,7 +172,7 @@ def _deserialize(type, value)
172172
end
173173
end
174174
else # model
175-
PatchRuby.const_get(type).build_from_hash(value)
175+
Patch.const_get(type).build_from_hash(value)
176176
end
177177
end
178178

lib/patch_ruby/models/order.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class Order
1717
attr_accessor :id
1818

@@ -87,13 +87,13 @@ def self.openapi_nullable
8787
# @param [Hash] attributes Model attributes in the form of hash
8888
def initialize(attributes = {})
8989
if (!attributes.is_a?(Hash))
90-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::Order` initialize method"
90+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::Order` initialize method"
9191
end
9292

9393
# check to see if the attribute exists and convert string to symbol for hash key
9494
attributes = attributes.each_with_object({}) { |(k, v), h|
9595
if (!self.class.attribute_map.key?(k.to_sym))
96-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
96+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::Order`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
9797
end
9898
h[k.to_sym] = v
9999
}
@@ -256,7 +256,7 @@ def _deserialize(type, value)
256256
end
257257
end
258258
else # model
259-
PatchRuby.const_get(type).build_from_hash(value)
259+
Patch.const_get(type).build_from_hash(value)
260260
end
261261
end
262262

lib/patch_ruby/models/order_list_response.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class OrderListResponse
1717
attr_accessor :success
1818

@@ -49,13 +49,13 @@ def self.openapi_nullable
4949
# @param [Hash] attributes Model attributes in the form of hash
5050
def initialize(attributes = {})
5151
if (!attributes.is_a?(Hash))
52-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::OrderListResponse` initialize method"
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::OrderListResponse` initialize method"
5353
end
5454

5555
# check to see if the attribute exists and convert string to symbol for hash key
5656
attributes = attributes.each_with_object({}) { |(k, v), h|
5757
if (!self.class.attribute_map.key?(k.to_sym))
58-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::OrderListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::OrderListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5959
end
6060
h[k.to_sym] = v
6161
}
@@ -174,7 +174,7 @@ def _deserialize(type, value)
174174
end
175175
end
176176
else # model
177-
PatchRuby.const_get(type).build_from_hash(value)
177+
Patch.const_get(type).build_from_hash(value)
178178
end
179179
end
180180

lib/patch_ruby/models/order_response.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class OrderResponse
1717
attr_accessor :success
1818

@@ -49,13 +49,13 @@ def self.openapi_nullable
4949
# @param [Hash] attributes Model attributes in the form of hash
5050
def initialize(attributes = {})
5151
if (!attributes.is_a?(Hash))
52-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::OrderResponse` initialize method"
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::OrderResponse` initialize method"
5353
end
5454

5555
# check to see if the attribute exists and convert string to symbol for hash key
5656
attributes = attributes.each_with_object({}) { |(k, v), h|
5757
if (!self.class.attribute_map.key?(k.to_sym))
58-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::OrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::OrderResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5959
end
6060
h[k.to_sym] = v
6161
}
@@ -172,7 +172,7 @@ def _deserialize(type, value)
172172
end
173173
end
174174
else # model
175-
PatchRuby.const_get(type).build_from_hash(value)
175+
Patch.const_get(type).build_from_hash(value)
176176
end
177177
end
178178

lib/patch_ruby/models/preference.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class Preference
1717
attr_accessor :id
1818

@@ -48,13 +48,13 @@ def self.openapi_nullable
4848
# @param [Hash] attributes Model attributes in the form of hash
4949
def initialize(attributes = {})
5050
if (!attributes.is_a?(Hash))
51-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::Preference` initialize method"
51+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::Preference` initialize method"
5252
end
5353

5454
# check to see if the attribute exists and convert string to symbol for hash key
5555
attributes = attributes.each_with_object({}) { |(k, v), h|
5656
if (!self.class.attribute_map.key?(k.to_sym))
57-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::Preference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::Preference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5858
end
5959
h[k.to_sym] = v
6060
}
@@ -171,7 +171,7 @@ def _deserialize(type, value)
171171
end
172172
end
173173
else # model
174-
PatchRuby.const_get(type).build_from_hash(value)
174+
Patch.const_get(type).build_from_hash(value)
175175
end
176176
end
177177

lib/patch_ruby/models/preference_list_response.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class PreferenceListResponse
1717
attr_accessor :success
1818

@@ -49,13 +49,13 @@ def self.openapi_nullable
4949
# @param [Hash] attributes Model attributes in the form of hash
5050
def initialize(attributes = {})
5151
if (!attributes.is_a?(Hash))
52-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::PreferenceListResponse` initialize method"
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::PreferenceListResponse` initialize method"
5353
end
5454

5555
# check to see if the attribute exists and convert string to symbol for hash key
5656
attributes = attributes.each_with_object({}) { |(k, v), h|
5757
if (!self.class.attribute_map.key?(k.to_sym))
58-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::PreferenceListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::PreferenceListResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5959
end
6060
h[k.to_sym] = v
6161
}
@@ -174,7 +174,7 @@ def _deserialize(type, value)
174174
end
175175
end
176176
else # model
177-
PatchRuby.const_get(type).build_from_hash(value)
177+
Patch.const_get(type).build_from_hash(value)
178178
end
179179
end
180180

lib/patch_ruby/models/preference_response.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
require 'date'
1414

15-
module PatchRuby
15+
module Patch
1616
class PreferenceResponse
1717
attr_accessor :success
1818

@@ -49,13 +49,13 @@ def self.openapi_nullable
4949
# @param [Hash] attributes Model attributes in the form of hash
5050
def initialize(attributes = {})
5151
if (!attributes.is_a?(Hash))
52-
fail ArgumentError, "The input argument (attributes) must be a hash in `PatchRuby::PreferenceResponse` initialize method"
52+
fail ArgumentError, "The input argument (attributes) must be a hash in `Patch::PreferenceResponse` initialize method"
5353
end
5454

5555
# check to see if the attribute exists and convert string to symbol for hash key
5656
attributes = attributes.each_with_object({}) { |(k, v), h|
5757
if (!self.class.attribute_map.key?(k.to_sym))
58-
fail ArgumentError, "`#{k}` is not a valid attribute in `PatchRuby::PreferenceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58+
fail ArgumentError, "`#{k}` is not a valid attribute in `Patch::PreferenceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
5959
end
6060
h[k.to_sym] = v
6161
}
@@ -172,7 +172,7 @@ def _deserialize(type, value)
172172
end
173173
end
174174
else # model
175-
PatchRuby.const_get(type).build_from_hash(value)
175+
Patch.const_get(type).build_from_hash(value)
176176
end
177177
end
178178

0 commit comments

Comments
 (0)