Class: WurflCloud::Configuration
- Inherits:
-
Object
- Object
- WurflCloud::Configuration
- Defined in:
- lib/wurfl_cloud/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
The API key to access the WurflCloud api (defaults to “100000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”).
-
#api_password ⇒ Object
readonly
The API password decoded from the api_key.
-
#api_type ⇒ Object
The API Type, defaults to http (*not used*).
-
#api_user ⇒ Object
readonly
The API user id decoded from the api_key.
-
#cache_class ⇒ Object
The cache class to be used (defaults to a WurflCloud::Cache::Null ).
-
#cache_options ⇒ Object
The cache_options to be used (defaults to {}).
-
#host ⇒ Object
The host to connect to (defaults to api.wurflcloud.com).
-
#path ⇒ Object
The path (URL) for the API endpoint at the host (defaults to /v1/json).
-
#port ⇒ Object
The port on which your WurflCloud server runs (defaults to 80).
-
#schema ⇒ Object
The schema of the URI for the api server (defaults to http).
-
#search_parameter ⇒ Object
The search parameter format (defaults to “search:(%capabilities)”).
-
#search_parameter_separator ⇒ Object
The search parameter capabilities separator (defaults to “,”).
Instance Method Summary collapse
- #api_uri ⇒ Object
-
#cache(environment) ⇒ Object
creates a cache instance using the class and the options given in the confinguration and passing whatever environment is passed in the parameters.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/wurfl_cloud/configuration.rb', line 52 def initialize @api_key = "100000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @api_user = 100000 @api_password = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" @host = 'api.wurflcloud.com' @schema = 'http' @port = 80 @path = '/v1/json' @api_type = 'http' @search_parameter = "search:(%{capabilities})" @search_parameter_separator = ',' @cache_class = WurflCloud::Cache::Null @cache_options = {} end |
Instance Attribute Details
#api_key ⇒ Object
The API key to access the WurflCloud api (defaults to “100000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”).
17 18 19 |
# File 'lib/wurfl_cloud/configuration.rb', line 17 def api_key @api_key end |
#api_password ⇒ Object (readonly)
The API password decoded from the api_key
23 24 25 |
# File 'lib/wurfl_cloud/configuration.rb', line 23 def api_password @api_password end |
#api_type ⇒ Object
The API Type, defaults to http (*not used*)
38 39 40 |
# File 'lib/wurfl_cloud/configuration.rb', line 38 def api_type @api_type end |
#api_user ⇒ Object (readonly)
The API user id decoded from the api_key
20 21 22 |
# File 'lib/wurfl_cloud/configuration.rb', line 20 def api_user @api_user end |
#cache_class ⇒ Object
The cache class to be used (defaults to a WurflCloud::Cache::Null )
47 48 49 |
# File 'lib/wurfl_cloud/configuration.rb', line 47 def cache_class @cache_class end |
#cache_options ⇒ Object
The cache_options to be used (defaults to {})
50 51 52 |
# File 'lib/wurfl_cloud/configuration.rb', line 50 def @cache_options end |
#host ⇒ Object
The host to connect to (defaults to api.wurflcloud.com).
29 30 31 |
# File 'lib/wurfl_cloud/configuration.rb', line 29 def host @host end |
#path ⇒ Object
The path (URL) for the API endpoint at the host (defaults to /v1/json).
35 36 37 |
# File 'lib/wurfl_cloud/configuration.rb', line 35 def path @path end |
#port ⇒ Object
The port on which your WurflCloud server runs (defaults to 80).
32 33 34 |
# File 'lib/wurfl_cloud/configuration.rb', line 32 def port @port end |
#schema ⇒ Object
The schema of the URI for the api server (defaults to http).
26 27 28 |
# File 'lib/wurfl_cloud/configuration.rb', line 26 def schema @schema end |
#search_parameter ⇒ Object
The search parameter format (defaults to “search:(%capabilities)”)
41 42 43 |
# File 'lib/wurfl_cloud/configuration.rb', line 41 def search_parameter @search_parameter end |
#search_parameter_separator ⇒ Object
The search parameter capabilities separator (defaults to “,”)
44 45 46 |
# File 'lib/wurfl_cloud/configuration.rb', line 44 def search_parameter_separator @search_parameter_separator end |
Instance Method Details
#api_uri ⇒ Object
77 78 79 |
# File 'lib/wurfl_cloud/configuration.rb', line 77 def api_uri "#{@schema}://#{@host}:#{@port}#{@path}" end |
#cache(environment) ⇒ Object
creates a cache instance using the class and the options given in the confinguration and passing whatever environment is passed in the parameters
84 85 86 |
# File 'lib/wurfl_cloud/configuration.rb', line 84 def cache(environment) @cache_class.new(@cache_options, environment) end |