Sha256: e48fccacf9858c8554811d51718dbac047390618a4e44e7b78cc0d4c2b2644e1

Contents?: true

Size: 468 Bytes

Versions: 23

Compression:

Stored size: 468 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::UI::Heroicon::Component",
    }.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

23 entries across 23 versions & 1 rubygems

Version Path
ariadne_view_components-0.0.82 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.81 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.80.3 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.79.2 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.79.1 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.79 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.78 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.77 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.76.1 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.76 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.75 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.74.1 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.74 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.73 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.72 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.71 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.70 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.69 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.68 app/lib/ariadne/view_helper.rb
ariadne_view_components-0.0.67 app/lib/ariadne/view_helper.rb