Sha256: 52245823a0772d43475e6e857fe68083ae0f6a4c9ee450052fa7e1c7715dc4e1
Contents?: true
Size: 568 Bytes
Versions: 14
Compression:
Stored size: 568 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::Beta::Heading", 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
14 entries across 14 versions & 1 rubygems