Welcome to mirror list, hosted at ThFree Co, Russian Federation.

reference_parser.rb « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c08d3364a875dc1f0c8bca740fe27b51989ca099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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