Class: Indexter::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/indexter/config.rb

Constant Summary collapse

DEFAULT_CONFIG_FILE =
'./.indexter.yaml'.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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

#exclusionsObject (readonly)

Returns the value of attribute exclusions.



16
17
18
# File 'lib/indexter/config.rb', line 16

def exclusions
  @exclusions
end

#formatObject (readonly)

Returns the value of attribute format.



16
17
18
# File 'lib/indexter/config.rb', line 16

def format
  @format
end

#suffixesObject (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

Returns:

  • (Boolean)


25
26
27
# File 'lib/indexter/config.rb', line 25

def exists?
  File.exists?(config_file_path)
end

#to_yamlObject



29
30
31
# File 'lib/indexter/config.rb', line 29

def to_yaml
  @data.to_yaml
end