# 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