Class: RailsRouteChecker::ConfigFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-route-checker/config_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ ConfigFile

Returns a new instance of ConfigFile.



5
6
7
# File 'lib/rails-route-checker/config_file.rb', line 5

def initialize(filename)
  @filename = filename
end

Instance Method Details

#configObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/rails-route-checker/config_file.rb', line 9

def config
  @config ||= begin
    hash = load_yaml_file
    {
      ignored_controllers: hash['ignored_controllers'] || [],
      ignored_paths: hash['ignored_paths'] || [],
      ignored_path_whitelist: hash['ignored_path_whitelist'] || []
    }
  end
end