Class: Wordchuck::Configuration
- Inherits:
-
Object
- Object
- Wordchuck::Configuration
- Defined in:
- lib/wordchuck/configuration.rb
Constant Summary collapse
- API_HOSTNAME =
"www.wordchuck.com"- API_PROJECT_KEY_LENGTH =
18
Instance Attribute Summary collapse
-
#backups ⇒ Object
Returns the value of attribute backups.
-
#project_key ⇒ Object
Returns the value of attribute project_key.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
Instance Method Summary collapse
- #api_host_url ⇒ Object
- #backups? ⇒ Boolean
- #has_project_key? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #quiet? ⇒ Boolean
- #ssl? ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 |
# File 'lib/wordchuck/configuration.rb', line 25 def initialize @project_key = nil @quiet = false @backups = false @ssl = false end |
Instance Attribute Details
#backups ⇒ Object
Returns the value of attribute backups.
20 21 22 |
# File 'lib/wordchuck/configuration.rb', line 20 def backups @backups end |
#project_key ⇒ Object
Returns the value of attribute project_key.
20 21 22 |
# File 'lib/wordchuck/configuration.rb', line 20 def project_key @project_key end |
#quiet ⇒ Object
Returns the value of attribute quiet.
20 21 22 |
# File 'lib/wordchuck/configuration.rb', line 20 def quiet @quiet end |
#ssl ⇒ Object
Returns the value of attribute ssl.
20 21 22 |
# File 'lib/wordchuck/configuration.rb', line 20 def ssl @ssl end |
Instance Method Details
#api_host_url ⇒ Object
45 46 47 |
# File 'lib/wordchuck/configuration.rb', line 45 def api_host_url ssl? ? "https://#{API_HOSTNAME}" : "http://#{API_HOSTNAME}" end |
#backups? ⇒ Boolean
38 39 40 |
# File 'lib/wordchuck/configuration.rb', line 38 def backups? @backups end |
#has_project_key? ⇒ Boolean
32 33 34 |
# File 'lib/wordchuck/configuration.rb', line 32 def has_project_key? (not @project_key.nil?) && @project_key.is_a?(String) && @project_key.length == API_PROJECT_KEY_LENGTH end |
#quiet? ⇒ Boolean
35 36 37 |
# File 'lib/wordchuck/configuration.rb', line 35 def quiet? @quiet end |
#ssl? ⇒ Boolean
41 42 43 |
# File 'lib/wordchuck/configuration.rb', line 41 def ssl? @ssl end |