Class: ChannelAdvisor::AuthHandler

Inherits:
SOAP::Header::SimpleHandler
  • Object
show all
Defined in:
lib/channel_advisor/auth_handler.rb

Constant Summary collapse

API_CREDENTIALS =
XSD::QName.new('http://api.channeladvisor.com/webservices/', 'APICredentials')
DEVELOPER_KEY =
XSD::QName.new('http://api.channeladvisor.com/webservices/', 'DeveloperKey')
PASSWORD =
XSD::QName.new('http://api.channeladvisor.com/webservices/', 'Password')

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(developer_key = nil, password = nil) ⇒ AuthHandler

Returns a new instance of AuthHandler.



11
12
13
14
15
# File 'lib/channel_advisor/auth_handler.rb', line 11

def initialize(developer_key = nil, password = nil)
  super(API_CREDENTIALS)
  @developer_key = developer_key || configatron.channel_advisor.developer_key
  @password = password || configatron.channel_advisor.password
end

Instance Attribute Details

#developer_keyObject

Returns the value of attribute developer_key.



9
10
11
# File 'lib/channel_advisor/auth_handler.rb', line 9

def developer_key
  @developer_key
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/channel_advisor/auth_handler.rb', line 9

def password
  @password
end

Instance Method Details

#on_simple_outboundObject



17
18
19
# File 'lib/channel_advisor/auth_handler.rb', line 17

def on_simple_outbound
  {PASSWORD => @password, DEVELOPER_KEY => @developer_key}
end