Sha256: df1f26e87c9be391627bb4b3b49f67342169f91d456ef0ac62578ab168362022
Contents?: true
Size: 528 Bytes
Versions: 141
Compression:
Stored size: 528 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::Beta::Octicon", heading: "Primer::Beta::Heading", image: "Primer::Alpha::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
141 entries across 141 versions & 2 rubygems