Class: Mws::Connection
- Inherits:
-
Object
- Object
- Mws::Connection
- Defined in:
- lib/mws/connection.rb
Instance Attribute Summary collapse
-
#feeds ⇒ Object
readonly
Returns the value of attribute feeds.
-
#merchant ⇒ Object
readonly
Returns the value of attribute merchant.
-
#orders ⇒ Object
readonly
Returns the value of attribute orders.
Instance Method Summary collapse
- #get(path, params, overrides) ⇒ Object
-
#initialize(overrides) ⇒ Connection
constructor
A new instance of Connection.
- #post(path, params, body, overrides) ⇒ Object
Constructor Details
#initialize(overrides) ⇒ Connection
Returns a new instance of Connection.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/mws/connection.rb', line 13 def initialize(overrides) @log = Logging.logger[self] @scheme = overrides[:scheme] || 'https' @host = overrides[:host] || 'mws.amazonservices.com' @merchant = overrides[:merchant] raise Mws::Errors::ValidationError, 'A merchant identifier must be specified.' if @merchant.nil? @access = overrides[:access] raise Mws::Errors::ValidationError, 'An access key must be specified.' if @access.nil? @secret = overrides[:secret] raise Mws::Errors::ValidationError, 'A secret key must be specified.' if @secret.nil? @orders = Apis::Orders.new self @feeds = Apis::Feeds::Api.new self end |
Instance Attribute Details
#feeds ⇒ Object (readonly)
Returns the value of attribute feeds.
11 12 13 |
# File 'lib/mws/connection.rb', line 11 def feeds @feeds end |
#merchant ⇒ Object (readonly)
Returns the value of attribute merchant.
11 12 13 |
# File 'lib/mws/connection.rb', line 11 def merchant @merchant end |
#orders ⇒ Object (readonly)
Returns the value of attribute orders.
11 12 13 |
# File 'lib/mws/connection.rb', line 11 def orders @orders end |
Instance Method Details
#get(path, params, overrides) ⇒ Object
27 28 29 |
# File 'lib/mws/connection.rb', line 27 def get(path, params, overrides) request(:get, path, params, nil, overrides) end |
#post(path, params, body, overrides) ⇒ Object
31 32 33 |
# File 'lib/mws/connection.rb', line 31 def post(path, params, body, overrides) request(:post, path, params, body, overrides) end |