Class: Memoria::Configuration
- Inherits:
-
Object
- Object
- Memoria::Configuration
- Defined in:
- lib/memoria/configuration.rb
Overview
Stores the configuration of the gem.
Constant Summary collapse
- VALID_SNAPSHOT_RECORD_MODES =
The only allowed snapshot record modes.
%i[all new_episodes none].freeze
Instance Attribute Summary collapse
-
#snapshot_directory ⇒ String
Directory where the snapshots will be saved.
-
#snapshot_extension ⇒ String
File extension of new snapshots.
-
#snapshot_record_mode ⇒ String
The way the snapshots are recorded.
Instance Method Summary collapse
-
#add_setting(name, &block) ⇒ Symbol
Adds a new setting with the given
name
. -
#initialize ⇒ Configuration
constructor
Creates an instance of the configuration.
Constructor Details
#initialize ⇒ Configuration
Creates an instance of the configuration.
33 34 35 36 |
# File 'lib/memoria/configuration.rb', line 33 def initialize self.snapshot_extension = 'snap' self.snapshot_record_mode = :new_episodes end |
Instance Attribute Details
#snapshot_directory ⇒ String
Returns Directory where the snapshots will be saved.
12 13 14 |
# File 'lib/memoria/configuration.rb', line 12 def snapshot_directory @snapshot_directory end |
#snapshot_extension ⇒ String
Returns File extension of new snapshots.
22 23 24 |
# File 'lib/memoria/configuration.rb', line 22 def snapshot_extension @snapshot_extension end |
#snapshot_record_mode ⇒ String
Returns The way the snapshots are recorded.
17 18 19 |
# File 'lib/memoria/configuration.rb', line 17 def snapshot_record_mode @snapshot_record_mode end |
Instance Method Details
#add_setting(name, &block) ⇒ Symbol
Adds a new setting with the given name
.
89 90 91 92 |
# File 'lib/memoria/configuration.rb', line 89 def add_setting(name, &block) validate_setting_existence(name) define_singleton_method(name, block) end |