Class: StandupMD::Config::Entry
- Inherits:
-
Object
- Object
- StandupMD::Config::Entry
- Defined in:
- lib/standup_md/config/entry.rb
Overview
The configuration class for StandupMD::Entry
Constant Summary collapse
- DEFAULTS =
The default options.
{ current: ["<!-- ADD TODAY'S WORK HERE -->"], previous: [], impediments: ["None"], notes: [] }.freeze
- CONFIG_ATTRIBUTES =
Attributes copied into request-scoped config snapshots.
DEFAULTS.keys.freeze
Instance Attribute Summary collapse
-
#current ⇒ Array
Tasks for “Current” section.
-
#impediments ⇒ Array
Impediments for this entry.
-
#notes ⇒ Array
Notes for this entry.
-
#previous ⇒ Array
Tasks for “Previous” section.
Instance Method Summary collapse
-
#copy_from(config) ⇒ StandupMD::Config::Entry
Copies values from another entry config.
-
#initialize ⇒ Entry
constructor
Initializes the config with default values.
-
#reset ⇒ Hash
Sets all config values back to their defaults.
Constructor Details
#initialize ⇒ Entry
Initializes the config with default values.
59 60 61 |
# File 'lib/standup_md/config/entry.rb', line 59 def initialize reset end |
Instance Attribute Details
#current ⇒ Array
Tasks for “Current” section.
31 32 33 |
# File 'lib/standup_md/config/entry.rb', line 31 def current @current end |
#impediments ⇒ Array
Impediments for this entry.
47 48 49 |
# File 'lib/standup_md/config/entry.rb', line 47 def impediments @impediments end |
#notes ⇒ Array
Notes for this entry.
55 56 57 |
# File 'lib/standup_md/config/entry.rb', line 55 def notes @notes end |
#previous ⇒ Array
Tasks for “Previous” section.
39 40 41 |
# File 'lib/standup_md/config/entry.rb', line 39 def previous @previous end |
Instance Method Details
#copy_from(config) ⇒ StandupMD::Config::Entry
Copies values from another entry config.
77 78 79 80 81 82 83 84 85 |
# File 'lib/standup_md/config/entry.rb', line 77 def copy_from(config) CONFIG_ATTRIBUTES.each do |attribute| instance_variable_set( "@#{attribute}", copy_default(config.public_send(attribute)) ) end self end |
#reset ⇒ Hash
Sets all config values back to their defaults.
67 68 69 |
# File 'lib/standup_md/config/entry.rb', line 67 def reset DEFAULTS.each { |k, v| instance_variable_set("@#{k}", copy_default(v)) } end |