Class: PreCommit::Checks::Plugin::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/pre-commit/checks/plugin/config_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, config, alternate_location) ⇒ ConfigFile

Returns a new instance of ConfigFile.


5
6
7
8
9
# File 'lib/pre-commit/checks/plugin/config_file.rb', line 5

def initialize(name, config, alternate_location)
  @name = name
  @config = config
  @alternate_location = alternate_location
end

Instance Method Details

#locationObject


11
12
13
14
15
# File 'lib/pre-commit/checks/plugin/config_file.rb', line 11

def location
  return @location if defined?(@location)

  @location = location_from_config || location_from_alternate
end