Class: Zedkit::Configuration
- Inherits:
-
Object
- Object
- Zedkit::Configuration
- Defined in:
- lib/zedkit/client/configuration.rb
Constant Summary collapse
- API_HOSTNAME =
'api.zedapi.com'- API_PORT =
80- PROJECT_KEY_LENGTH =
18- LOCALES_KEY_LENGTH =
18
Instance Attribute Summary collapse
-
#api_host ⇒ Object
Returns the value of attribute api_host.
-
#api_port ⇒ Object
Returns the value of attribute api_port.
-
#exceptions ⇒ Object
Returns the value of attribute exceptions.
-
#locales_key ⇒ Object
Returns the value of attribute locales_key.
-
#project_key ⇒ Object
Returns the value of attribute project_key.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
Instance Method Summary collapse
- #api_url ⇒ Object
- #exceptions? ⇒ Boolean
- #has_locales_key? ⇒ Boolean
- #has_project_key? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #ssl? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 32 33 |
# File 'lib/zedkit/client/configuration.rb', line 27 def initialize @project_key, @locales_key = nil, nil @ssl = false @exceptions = false @api_host = API_HOSTNAME @api_port = API_PORT end |
Instance Attribute Details
#api_host ⇒ Object
Returns the value of attribute api_host.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def api_host @api_host end |
#api_port ⇒ Object
Returns the value of attribute api_port.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def api_port @api_port end |
#exceptions ⇒ Object
Returns the value of attribute exceptions.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def exceptions @exceptions end |
#locales_key ⇒ Object
Returns the value of attribute locales_key.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def locales_key @locales_key end |
#project_key ⇒ Object
Returns the value of attribute project_key.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def project_key @project_key end |
#ssl ⇒ Object
Returns the value of attribute ssl.
20 21 22 |
# File 'lib/zedkit/client/configuration.rb', line 20 def ssl @ssl end |
Instance Method Details
#api_url ⇒ Object
49 50 51 |
# File 'lib/zedkit/client/configuration.rb', line 49 def api_url ssl? ? "https://#{api_host}:#{api_port}" : "http://#{api_host}:#{api_port}" end |
#exceptions? ⇒ Boolean
45 46 47 |
# File 'lib/zedkit/client/configuration.rb', line 45 def exceptions? exceptions end |
#has_locales_key? ⇒ Boolean
38 39 40 |
# File 'lib/zedkit/client/configuration.rb', line 38 def has_locales_key? (not locales_key.nil?) && locales_key.is_a?(String) && locales_key.length == LOCALES_KEY_LENGTH end |
#has_project_key? ⇒ Boolean
35 36 37 |
# File 'lib/zedkit/client/configuration.rb', line 35 def has_project_key? (not project_key.nil?) && project_key.is_a?(String) && project_key.length == PROJECT_KEY_LENGTH end |
#ssl? ⇒ Boolean
42 43 44 |
# File 'lib/zedkit/client/configuration.rb', line 42 def ssl? ssl end |