Sha256: d4f50d7bf7d28466a38ba6527467e5e570782ff858e36bc0a93a182bd6d72988
Contents?: true
Size: 571 Bytes
Versions: 39
Compression:
Stored size: 571 Bytes
Contents
# frozen_string_literal: true # :nocov: module Primer # Module to allow shorthand calls for Primer components module ViewHelper class ViewHelperNotFound < StandardError; end HELPERS = { octicon: "Primer::OcticonComponent", heading: "Primer::HeadingComponent", time_ago: "Primer::TimeAgoComponent", image: "Primer::Image" }.freeze HELPERS.each do |name, component| define_method "primer_#{name}" do |*args, **kwargs, &block| render component.constantize.new(*args, **kwargs), &block end end end end
Version data entries
39 entries across 39 versions & 1 rubygems