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