Commit 0784b8395cb1c70f20776c96106565ca4cb54271
1 parent
d1dd675d
Exists in
master
添加api_user
Showing
2 changed files
with
6 additions
and
6 deletions
Show diff stats
lib/sendcloud/client.rb
... | ... | @@ -2,11 +2,11 @@ require 'rest_client' |
2 | 2 | |
3 | 3 | module Sendcloud |
4 | 4 | class Client |
5 | - attr_reader :api_key, :domain, :api_url | |
5 | + attr_reader :api_key, :api_user, :api_url | |
6 | 6 | |
7 | - def initialize(api_key, domain) | |
7 | + def initialize(api_key, api_user, api_url) | |
8 | 8 | @api_key = api_key |
9 | - @domain = domain | |
9 | + @api_user = api_user | |
10 | 10 | @api_url = api_url |
11 | 11 | end |
12 | 12 | ... | ... |
lib/sendcloud/deliverer.rb
... | ... | @@ -7,8 +7,8 @@ module Sendcloud |
7 | 7 | self.settings = settings |
8 | 8 | end |
9 | 9 | |
10 | - def domain | |
11 | - self.settings[:domain] | |
10 | + def api_user | |
11 | + self.settings[:api_user] | |
12 | 12 | end |
13 | 13 | |
14 | 14 | def api_key |
... | ... | @@ -90,7 +90,7 @@ module Sendcloud |
90 | 90 | end |
91 | 91 | |
92 | 92 | def sendcloud_client |
93 | - @sendcloud_client ||= Client.new(api_key, domain) | |
93 | + @sendcloud_client ||= Client.new(api_key, api_user, api_url) | |
94 | 94 | end |
95 | 95 | end |
96 | 96 | end | ... | ... |