lalamove 0.11.0 → 0.12.0
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/Gemfile.lock +1 -1
- data/README.md +7 -1
- data/lib/lalamove/configuration.rb +12 -11
- data/lib/lalamove/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb789fbfcd7f341b87407b2fb87ae016d47f1ad51b875d5754f4e1e286e9bf4f
|
|
4
|
+
data.tar.gz: e047e93eeb6de67c02ac603910039506e6e4903c274fe979326cac65fb46c3be
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 920b25c0137cca2054c9d78763d6e11cf742f24b7eb5ef808755d4a9562a0b3869392ec21c741d8d015fa4b108d2fbd4e53a4201855e185e9413c4611360fae2
|
|
7
|
+
data.tar.gz: 920fba3be058991e94908b96aa9546dc8a7cb98b9978a173f0287c7745231e2f67a1f7724a08ba61bdb4c410c0701d03c2f7559ec8944d9d268298f62906e696
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -21,13 +21,19 @@ Or install it yourself as:
|
|
|
21
21
|
$ gem install lalamove
|
|
22
22
|
|
|
23
23
|
## Configuration
|
|
24
|
+
You can generate initializer using this command
|
|
25
|
+
```ruby
|
|
26
|
+
rails generate initializer lalamove
|
|
27
|
+
```
|
|
28
|
+
It will generate automatically like this. Or you can create manually.
|
|
29
|
+
|
|
24
30
|
```ruby
|
|
25
31
|
config/initializer/lalamove.rb
|
|
26
32
|
Lalamove.configure do |config|
|
|
27
33
|
config.mode = :sandbox
|
|
28
34
|
config.key = 'your_key'
|
|
29
35
|
config.secret_key = 'your_secret_key'
|
|
30
|
-
config.country_code = [Check all available countries here](https://developers.lalamove.com/?plaintext--sandbox#available-countries)
|
|
36
|
+
config.country_code = [Check all available countries here](https://developers.lalamove.com/?plaintext--sandbox#available-countries){:target="_blank"}
|
|
31
37
|
end
|
|
32
38
|
|
|
33
39
|
Set config.mode to either :sandbox or :prod to switch between the sandbox and prod endpoints, keys to the corresponding keys provided by Lalamove.
|
|
@@ -4,24 +4,25 @@
|
|
|
4
4
|
module Lalamove
|
|
5
5
|
# Configuration
|
|
6
6
|
class Configuration
|
|
7
|
-
attr_accessor :key, :secret_key, :country_code
|
|
8
|
-
attr_writer :base_url, :mode
|
|
7
|
+
attr_accessor :key, :secret_key, :country_code, :mode, :base_url
|
|
9
8
|
end
|
|
10
9
|
|
|
11
10
|
SANDBOX_BASE_URL = 'https://sandbox-rest.lalamove.com'
|
|
12
11
|
PROD_BASE_URL = 'https://rest.lalamove.com'
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
# Config Module
|
|
14
|
+
module Config
|
|
15
|
+
def self.base_url
|
|
16
|
+
return @base_url unless @base_url.nil?
|
|
17
|
+
return SANDBOX_BASE_URL if @mode == :sandbox
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
PROD_BASE_URL
|
|
20
|
+
end
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
def self.mode
|
|
23
|
+
return @mode unless @mode.nil?
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
:sandbox
|
|
26
|
+
end
|
|
26
27
|
end
|
|
27
28
|
end
|
data/lib/lalamove/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lalamove
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jessie Arevalo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-02-03 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|