Module: Express

Includes:
Company, HTTParty
Defined in:
lib/china-express.rb,
lib/express/result.rb,
lib/express/company.rb

Overview

快递查询

Defined Under Namespace

Modules: Company Classes: Result

Constant Summary

Constants included from Company

Company::MATCHES

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Company

included

Class Attribute Details

.keyObject

Returns the value of attribute key.



15
16
17
# File 'lib/china-express.rb', line 15

def key
  @key
end

Class Method Details

.search(number, company, key = nil) ⇒ Object



20
21
22
23
24
# File 'lib/china-express.rb', line 20

def self.search(number, company, key = nil)
  options= { com: company_code(company), nu: number, id: (key || self.key )}
  body = get("/", query: options).body
  Result.new JSON(body)
end