Module: Taobao
- Defined in:
- lib/taobao/base.rb,
lib/taobao/search.rb
Defined Under Namespace
Classes: ApiError, Category, IncorrectCategoryId, Product, ProductList
Constant Summary collapse
- API_VERSION =
'2.0'
- PRODUCTION_URL =
'http://gw.api.taobao.com/router/rest'
Class Attribute Summary collapse
-
.private_key ⇒ Object
writeonly
Sets the attribute private_key.
-
.public_key ⇒ Object
Returns the value of attribute public_key.
Class Method Summary collapse
Class Attribute Details
.private_key=(value) ⇒ Object (writeonly)
Sets the attribute private_key
13 14 15 |
# File 'lib/taobao/base.rb', line 13 def private_key=(value) @private_key = value end |
.public_key ⇒ Object
Returns the value of attribute public_key.
12 13 14 |
# File 'lib/taobao/base.rb', line 12 def public_key @public_key end |
Class Method Details
.api_request(options) ⇒ Object
16 17 18 19 20 |
# File 'lib/taobao/base.rb', line 16 def self.api_request() uri = URI(PRODUCTION_URL) response = Net::HTTP.post_form uri, self.() parse_to_hash response end |
.search(query) ⇒ Object
2 3 4 |
# File 'lib/taobao/search.rb', line 2 def self.search(query) ProductList.new(q: query) end |