debian-mirror-gitlab/lib/banzai/reference_parser.rb
2019-12-21 20:55:43 +05:30

16 lines
374 B
Ruby

# frozen_string_literal: true
module Banzai
module ReferenceParser
# Returns the reference parser class for the given type
#
# Example:
#
# Banzai::ReferenceParser['issue']
#
# This would return the `Banzai::ReferenceParser::IssueParser` class.
def self.[](name)
const_get("#{name.to_s.camelize}Parser", false)
end
end
end