summaryrefslogtreecommitdiff
path: root/lib/banzai/reference_parser.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/reference_parser.rb')
-rw-r--r--lib/banzai/reference_parser.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/banzai/reference_parser.rb b/lib/banzai/reference_parser.rb
new file mode 100644
index 00000000000..557bec4316e
--- /dev/null
+++ b/lib/banzai/reference_parser.rb
@@ -0,0 +1,14 @@
+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")
+ end
+ end
+end