Class: RakutenWebService::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rakuten_web_service/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
# File 'lib/rakuten_web_service/configuration.rb', line 7

def initialize
  @max_retries = 5
end

Instance Attribute Details

#affiliate_idObject

Returns the value of attribute affiliate_id.



5
6
7
# File 'lib/rakuten_web_service/configuration.rb', line 5

def affiliate_id
  @affiliate_id
end

#application_idObject

Returns the value of attribute application_id.



5
6
7
# File 'lib/rakuten_web_service/configuration.rb', line 5

def application_id
  @application_id
end

#debugObject

Returns the value of attribute debug.



5
6
7
# File 'lib/rakuten_web_service/configuration.rb', line 5

def debug
  @debug
end

#max_retriesObject

Returns the value of attribute max_retries.



5
6
7
# File 'lib/rakuten_web_service/configuration.rb', line 5

def max_retries
  @max_retries
end

Instance Method Details

#debug_mode?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rakuten_web_service/configuration.rb', line 19

def debug_mode?
  ENV.has_key?('RWS_SDK_DEBUG') || debug
end

#default_parametersObject



15
16
17
# File 'lib/rakuten_web_service/configuration.rb', line 15

def default_parameters 
  { :application_id => application_id, :affiliate_id => affiliate_id }
end

#generate_parameters(params) ⇒ Object



11
12
13
# File 'lib/rakuten_web_service/configuration.rb', line 11

def generate_parameters(params)
  convert_snake_key_to_camel_key(default_parameters.merge(params))
end