Class: Scene7::Config
- Inherits:
-
Object
- Object
- Scene7::Config
- Defined in:
- lib/scene7/config.rb
Constant Summary collapse
- AUTH_NAMESPACE =
"http://www.scene7.com/IpsApi/xsd"
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#app_version ⇒ Object
readonly
Returns the value of attribute app_version.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#subdomain ⇒ Object
readonly
Returns the value of attribute subdomain.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #endpoint ⇒ Object
- #header ⇒ Object
-
#initialize(subdomain, user, password, app_name, app_version) ⇒ Config
constructor
A new instance of Config.
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_name ⇒ Object (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_version ⇒ Object (readonly)
Returns the value of attribute app_version.
5 6 7 |
# File 'lib/scene7/config.rb', line 5 def app_version @app_version end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/scene7/config.rb', line 5 def password @password end |
#subdomain ⇒ Object (readonly)
Returns the value of attribute subdomain.
5 6 7 |
# File 'lib/scene7/config.rb', line 5 def subdomain @subdomain end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'lib/scene7/config.rb', line 5 def user @user end |
Instance Method Details
#endpoint ⇒ Object
17 18 19 |
# File 'lib/scene7/config.rb', line 17 def endpoint "https://#{subdomain}.scene7.com/scene7/services/IpsApiService" end |
#header ⇒ Object
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 |