Sha256: dda9594c1c1a6e99763406af615427b870ca2c1057aa9df88a167c4afe167436
Contents?: true
Size: 947 Bytes
Versions: 7
Compression:
Stored size: 947 Bytes
Contents
# frozen_string_literal: true module Ariadne # Add a general description of component here # Add additional usage considerations or best practices that may aid the user to use the component correctly. # @accessibility Add any accessibility considerations class MainComponent < Ariadne::Component DEFAULT_CLASSES = "flex-auto" # @example Default # # <%= render(Ariadne::MainComponent.new) { "Example" } %> # # @param classes [String] <%= link_to_classes_docs %> # @param attributes [Hash] <%= link_to_attributes_docs %> def initialize(classes: "", attributes: {}) @tag = :main @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end def call render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) do render(Ariadne::ContainerComponent.new) { content } end end end end
Version data entries
7 entries across 7 versions & 1 rubygems