Class: PublishToWeb::Config
- Inherits:
-
Object
- Object
- PublishToWeb::Config
- Defined in:
- lib/publish_to_web/config.rb
Class Method Summary collapse
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize(store: SKVS) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(store: SKVS) ⇒ Config
Returns a new instance of Config.
16 17 18 |
# File 'lib/publish_to_web/config.rb', line 16 def initialize(store: SKVS) @store = store end |
Class Method Details
.config_attribute(name, key) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/publish_to_web/config.rb', line 6 def self.config_attribute(name, key) define_method name do store.get key end define_method "#{name}=" do |value| store.set key, value end end |
Instance Method Details
#enabled? ⇒ Boolean
20 21 22 |
# File 'lib/publish_to_web/config.rb', line 20 def enabled? !!store.get('ptw/enabled') end |