Class: SiteClassifier::Configuration
- Inherits:
-
Object
- Object
- SiteClassifier::Configuration
- Defined in:
- lib/site_classifier/configuration.rb
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#google_translate_api_key ⇒ Object
Returns the value of attribute google_translate_api_key.
-
#translate ⇒ Object
Returns the value of attribute translate.
Class Method Summary collapse
-
.configure {|new_configuration| ... } ⇒ Object
Configure by block.
Instance Method Summary collapse
- #debug? ⇒ Boolean
-
#initialize(options = {}) ⇒ Configuration
constructor
Instantiate a new class.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Instantiate a new class
6 7 8 9 10 |
# File 'lib/site_classifier/configuration.rb', line 6 def initialize( = {}) @translate = [:translate] || false @google_translate_api_key = [:google_translate_api_key] @debug = [:debug] || false end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
3 4 5 |
# File 'lib/site_classifier/configuration.rb', line 3 def debug @debug end |
#google_translate_api_key ⇒ Object
Returns the value of attribute google_translate_api_key.
3 4 5 |
# File 'lib/site_classifier/configuration.rb', line 3 def google_translate_api_key @google_translate_api_key end |
#translate ⇒ Object
Returns the value of attribute translate.
3 4 5 |
# File 'lib/site_classifier/configuration.rb', line 3 def translate @translate end |
Class Method Details
.configure {|new_configuration| ... } ⇒ Object
Configure by block
17 18 19 20 21 |
# File 'lib/site_classifier/configuration.rb', line 17 def self.configure(&block) new_configuration = SiteClassifier::Configuration.new yield new_configuration new_configuration end |
Instance Method Details
#debug? ⇒ Boolean
12 13 14 |
# File 'lib/site_classifier/configuration.rb', line 12 def debug? self.debug == true end |