Class: Smyte::Config
- Inherits:
-
Object
- Object
- Smyte::Config
- Defined in:
- lib/smyte/config.rb
Instance Attribute Summary collapse
- #api_key ⇒ Object
- #api_secret ⇒ Object
-
#logger ⇒ Object
Returns the value of attribute logger.
- #webhook_secret ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
6 7 8 9 |
# File 'lib/smyte/config.rb', line 6 def api_key return @api_key if @api_key raise "Smyte api_key not set" end |
#api_secret ⇒ Object
11 12 13 14 |
# File 'lib/smyte/config.rb', line 11 def api_secret return @api_secret if @api_secret raise "Smyte api_secret not set" end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/smyte/config.rb', line 3 def logger @logger end |
#webhook_secret ⇒ Object
16 17 18 19 |
# File 'lib/smyte/config.rb', line 16 def webhook_secret return @webhook_secret if @webhook_secret raise "Smyte webhook_secret not set" end |
Instance Method Details
#enabled ⇒ Object
25 26 27 28 |
# File 'lib/smyte/config.rb', line 25 def enabled return true if @enabled.nil? @enabled end |
#enabled=(input) ⇒ Object
21 22 23 |
# File 'lib/smyte/config.rb', line 21 def enabled=input @enabled = !!(input.to_s =~ /^(t|1|y|ok)/) end |
#enabled? ⇒ Boolean
30 31 32 |
# File 'lib/smyte/config.rb', line 30 def enabled? enabled end |