Sha256: 62e46b2da85d022fa35f4dc49dc524aa70ac0e654ac5750bb6bf09d802782cb8
Contents?: true
Size: 575 Bytes
Versions: 10
Compression:
Stored size: 575 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::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
10 entries across 10 versions & 1 rubygems