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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 4 additions & 4 deletions
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

0 commit comments

Comments
 (0)