Class: Scene7::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/scene7/config.rb

Constant Summary collapse

AUTH_NAMESPACE =
"http://www.scene7.com/IpsApi/xsd"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subdomain, user, password, app_name, app_version) ⇒ Config

Returns a new instance of Config.



9
10
11
12
13
14
15
# File 'lib/scene7/config.rb', line 9

def initialize(subdomain, user, password, app_name, app_version)
  @subdomain   = subdomain
  @user        = user
  @password    = password
  @app_name    = app_name
  @app_version = app_version
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name.



5
6
7
# File 'lib/scene7/config.rb', line 5

def app_name
  @app_name
end

#app_versionObject (readonly)

Returns the value of attribute app_version.



5
6
7
# File 'lib/scene7/config.rb', line 5

def app_version
  @app_version
end

#passwordObject (readonly)

Returns the value of attribute password.



5
6
7
# File 'lib/scene7/config.rb', line 5

def password
  @password
end

#subdomainObject (readonly)

Returns the value of attribute subdomain.



5
6
7
# File 'lib/scene7/config.rb', line 5

def subdomain
  @subdomain
end

#userObject (readonly)

Returns the value of attribute user.



5
6
7
# File 'lib/scene7/config.rb', line 5

def user
  @user
end

Instance Method Details

#endpointObject



17
18
19
# File 'lib/scene7/config.rb', line 17

def endpoint
  "https://#{subdomain}.scene7.com/scene7/services/IpsApiService"
end

#headerObject



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/scene7/config.rb', line 21

def header
  {
    :auth_header => {
    :user => user,
    :password => password,
    :app_name => app_name,
    :app_version => app_version
  },
    :attributes! => { :auth_header => { :xmlns => AUTH_NAMESPACE } }
  }
end