gocardless 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/CHANGELOG.md +4 -0
- data/lib/gocardless/client.rb +15 -0
- data/lib/gocardless/version.rb +1 -1
- data/spec/client_spec.rb +13 -0
- metadata +2 -2
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/gocardless/client.rb
CHANGED
@@ -268,6 +268,21 @@ module GoCardless
|
|
268
268
|
signature_valid?(params)
|
269
269
|
end
|
270
270
|
|
271
|
+
# Set the base URL for this client instance. Overrides all other settings
|
272
|
+
# (setting the environment globally, setting the Client class's base URL).
|
273
|
+
#
|
274
|
+
# @param [String] url the base URL to use
|
275
|
+
def base_url=(url)
|
276
|
+
@base_url = url
|
277
|
+
end
|
278
|
+
|
279
|
+
# Get the base URL for the client. If set manually for the instance, that
|
280
|
+
# URL will be returned. Otherwise, it will be deferred to
|
281
|
+
# +Client.base_url+.
|
282
|
+
def base_url
|
283
|
+
@base_url || self.class.base_url
|
284
|
+
end
|
285
|
+
|
271
286
|
private
|
272
287
|
|
273
288
|
# Return the merchant id, throwing a proper error if it's missing.
|
data/lib/gocardless/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -469,4 +469,17 @@ describe GoCardless::Client do
|
|
469
469
|
should be_true
|
470
470
|
end
|
471
471
|
end
|
472
|
+
|
473
|
+
describe "base_url" do
|
474
|
+
it "returns a custom base URL when one has been set" do
|
475
|
+
@client.base_url = 'http://test.com/'
|
476
|
+
@client.base_url.should == 'http://test.com/'
|
477
|
+
end
|
478
|
+
|
479
|
+
it "returns the default value when base_url is not set for the instance" do
|
480
|
+
GoCardless::Client.stubs(:base_url => 'http://gc.com/')
|
481
|
+
@client.base_url.should == 'http://gc.com/'
|
482
|
+
end
|
483
|
+
end
|
472
484
|
end
|
485
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-11-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: oauth2
|