Module: Kuaidi100::Service
- Defined in:
- lib/kuaidi100/service.rb
Constant Summary collapse
- KUAIDI100_URL =
'http://api.kuaidi100.com/api'
Class Method Summary collapse
Instance Method Summary collapse
-
#check_query ⇒ Object
TODO: check params.
Class Method Details
.create_url(options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/kuaidi100/service.rb', line 7 def self.create_url( = {}) = { 'id' => Kuaidi100.key }.merge(Utils.stringify_keys()) "#{ KUAIDI100_URL }?#{query_string()}" end |
.query_string(options) ⇒ Object
12 13 14 15 16 |
# File 'lib/kuaidi100/service.rb', line 12 def self.query_string() .map do |key, value| "#{ CGI.escape(key.to_s) }=#{ CGI.escape(value.to_s) }" end.join('&') end |
Instance Method Details
#check_query ⇒ Object
TODO: check params
19 20 |
# File 'lib/kuaidi100/service.rb', line 19 def check_query end |