Method: LegacyFacter::Util::Parser.parser_for

Defined in:
lib/facter/custom_facts/util/parser.rb

.parser_for(filename) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/facter/custom_facts/util/parser.rb', line 35

def self.parser_for(filename)
  registration = @parsers.detect { |k| k[1].call(filename) }

  if registration.nil?
    NothingParser.new
  else
    registration[0].new(filename)
  end
end