Class: Mws::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/mws/connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#feedsObject (readonly)

Returns the value of attribute feeds.



11
12
13
# File 'lib/mws/connection.rb', line 11

def feeds
  @feeds
end

#merchantObject (readonly)

Returns the value of attribute merchant.



11
12
13
# File 'lib/mws/connection.rb', line 11

def merchant
  @merchant
end

#ordersObject (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