Class: StandupMD::Config::File
- Inherits:
-
Object
- Object
- StandupMD::Config::File
- Defined in:
- lib/standup_md/config/file.rb
Overview
The configuration class for StandupMD::File
Constant Summary collapse
- DEFAULTS =
The default options.
{ header_date_format: "%Y-%m-%d", header_depth: 1, sub_header_depth: 2, current_header: "Current", previous_header: "Previous", impediments_header: "Impediments", notes_header: "Notes", sub_header_order: %w[previous current impediments notes], directory: ::File.join(ENV["HOME"], ".cache", "standup_md"), bullet_character: "-", name_format: "%Y_%m.md", create: true }.freeze
Instance Attribute Summary collapse
-
#bullet_character ⇒ String
Character used as bullets for list entries.
-
#create ⇒ boolean
Should the file be created if it doesn’t exist?.
-
#current_header ⇒ String
String to be used as “Current” header.
-
#directory ⇒ String
The directory in which the files are located.
-
#header_date_format ⇒ String
The date format for entry headers.
-
#header_depth ⇒ Integer
Number of octothorps that should preface entry headers.
-
#impediments_header ⇒ String
String to be used as “Impediments” header.
-
#name_format ⇒ String
Format to be used for standup file names.
-
#notes_header ⇒ String
String to be used as “Notes” header.
-
#previous_header ⇒ String
String to be used as “Previous” header.
-
#sub_header_depth ⇒ Integer
Number of octothorps that should preface sub-headers.
-
#sub_header_order ⇒ Array
Preferred order for sub-headers.
Instance Method Summary collapse
-
#initialize ⇒ File
constructor
Initializes the config with default values.
-
#reset ⇒ Hash
Sets all config values back to their defaults.
Constructor Details
#initialize ⇒ File
Initializes the config with default values.
138 139 140 |
# File 'lib/standup_md/config/file.rb', line 138 def initialize reset end |
Instance Attribute Details
#bullet_character ⇒ String
Character used as bullets for list entries.
57 58 59 |
# File 'lib/standup_md/config/file.rb', line 57 def bullet_character @bullet_character end |
#create ⇒ boolean
Should the file be created if it doesn’t exist?
134 135 136 |
# File 'lib/standup_md/config/file.rb', line 134 def create @create end |
#current_header ⇒ String
String to be used as “Current” header.
67 68 69 |
# File 'lib/standup_md/config/file.rb', line 67 def current_header @current_header end |
#directory ⇒ String
The directory in which the files are located.
49 50 51 |
# File 'lib/standup_md/config/file.rb', line 49 def directory @directory end |
#header_date_format ⇒ String
The date format for entry headers. Will be parsed by strftime.
126 127 128 |
# File 'lib/standup_md/config/file.rb', line 126 def header_date_format @header_date_format end |
#header_depth ⇒ Integer
Number of octothorps that should preface entry headers.
33 34 35 |
# File 'lib/standup_md/config/file.rb', line 33 def header_depth @header_depth end |
#impediments_header ⇒ String
String to be used as “Impediments” header.
87 88 89 |
# File 'lib/standup_md/config/file.rb', line 87 def impediments_header @impediments_header end |
#name_format ⇒ String
Format to be used for standup file names. Should be parse-able by strftime, and should be a monthly date.
118 119 120 |
# File 'lib/standup_md/config/file.rb', line 118 def name_format @name_format end |
#notes_header ⇒ String
String to be used as “Notes” header.
97 98 99 |
# File 'lib/standup_md/config/file.rb', line 97 def notes_header @notes_header end |
#previous_header ⇒ String
String to be used as “Previous” header.
77 78 79 |
# File 'lib/standup_md/config/file.rb', line 77 def previous_header @previous_header end |
#sub_header_depth ⇒ Integer
Number of octothorps that should preface sub-headers.
41 42 43 |
# File 'lib/standup_md/config/file.rb', line 41 def sub_header_depth @sub_header_depth end |
#sub_header_order ⇒ Array
Preferred order for sub-headers.
107 108 109 |
# File 'lib/standup_md/config/file.rb', line 107 def sub_header_order @sub_header_order end |
Instance Method Details
#reset ⇒ Hash
Sets all config values back to their defaults.
146 147 148 |
# File 'lib/standup_md/config/file.rb', line 146 def reset DEFAULTS.each { |k, v| instance_variable_set("@#{k}", v) } end |