Class: Shoppr::Client
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#sandboxed ⇒ Object
readonly
Returns the value of attribute sandboxed.
-
#tracking_id ⇒ Object
readonly
Returns the value of attribute tracking_id.
Instance Method Summary collapse
- #generic_response ⇒ Object
-
#initialize(sandboxed = false) ⇒ Client
constructor
Get your api_key found here developer.shopping.com/docs/Getting_Started.
- #sandboxed? ⇒ Boolean
- #search(options = {}) ⇒ Object
Constructor Details
#initialize(sandboxed = false) ⇒ Client
Get your api_key found here developer.shopping.com/docs/Getting_Started
9 10 11 12 13 14 15 16 17 |
# File 'lib/shoppr/client.rb', line 9 def initialize(sandboxed=false) @api_key ||= Shoppr.api_key @tracking_id ||= Shoppr.tracking_id @sandboxed = sandboxed base_uri = (self.sandboxed? ? 'sandbox.api.shopping.com/publisher/3.0/rest' : 'publisher.usb.api.shopping.com/publisher/3.0/rest') self.class.base_uri base_uri end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/shoppr/client.rb', line 6 def api_key @api_key end |
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
6 7 8 |
# File 'lib/shoppr/client.rb', line 6 def api_version @api_version end |
#sandboxed ⇒ Object (readonly)
Returns the value of attribute sandboxed.
6 7 8 |
# File 'lib/shoppr/client.rb', line 6 def sandboxed @sandboxed end |
#tracking_id ⇒ Object (readonly)
Returns the value of attribute tracking_id.
6 7 8 |
# File 'lib/shoppr/client.rb', line 6 def tracking_id @tracking_id end |
Instance Method Details
#generic_response ⇒ Object
23 24 25 |
# File 'lib/shoppr/client.rb', line 23 def generic_response @generic_response ||= GenericResponse.new() end |
#sandboxed? ⇒ Boolean
19 20 21 |
# File 'lib/shoppr/client.rb', line 19 def sandboxed? !!@sandboxed end |
#search(options = {}) ⇒ Object
34 35 36 37 |
# File 'lib/shoppr/client.rb', line 34 def search(={}) # self.class.parser Proc.new {|response| GeneralSearchResponse.parse_search_results(response)} response = GeneralSearchResponse.new(.merge(())) end |