Class: Indexter::Config
- Inherits:
-
Object
- Object
- Indexter::Config
- Defined in:
- lib/indexter/config.rb
Constant Summary collapse
- DEFAULT_CONFIG_FILE =
'./.indexter.yaml'.freeze
Instance Attribute Summary collapse
-
#config_file_path ⇒ Object
readonly
Returns the value of attribute config_file_path.
-
#exclusions ⇒ Object
readonly
Returns the value of attribute exclusions.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#suffixes ⇒ Object
readonly
Returns the value of attribute suffixes.
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(config_file_path: DEFAULT_CONFIG_FILE) ⇒ Config
constructor
A new instance of Config.
- #to_yaml ⇒ Object
Constructor Details
#initialize(config_file_path: DEFAULT_CONFIG_FILE) ⇒ Config
Returns a new instance of Config.
20 21 22 23 |
# File 'lib/indexter/config.rb', line 20 def initialize(config_file_path: DEFAULT_CONFIG_FILE) @config_file_path = config_file_path configure if exists? end |
Instance Attribute Details
#config_file_path ⇒ Object (readonly)
Returns the value of attribute config_file_path.
16 17 18 |
# File 'lib/indexter/config.rb', line 16 def config_file_path @config_file_path end |
#exclusions ⇒ Object (readonly)
Returns the value of attribute exclusions.
16 17 18 |
# File 'lib/indexter/config.rb', line 16 def exclusions @exclusions end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
16 17 18 |
# File 'lib/indexter/config.rb', line 16 def format @format end |
#suffixes ⇒ Object (readonly)
Returns the value of attribute suffixes.
16 17 18 |
# File 'lib/indexter/config.rb', line 16 def suffixes @suffixes end |
Instance Method Details
#exists? ⇒ Boolean
25 26 27 |
# File 'lib/indexter/config.rb', line 25 def exists? File.exists?(config_file_path) end |
#to_yaml ⇒ Object
29 30 31 |
# File 'lib/indexter/config.rb', line 29 def to_yaml @data.to_yaml end |