Class: Ariadne::BodyComponent
- Defined in:
- app/components/ariadne/body_component.rb
Overview
Add a general description of component here Add additional usage considerations or best practices that may aid the user to use the component correctly.
Constant Summary collapse
- DEFAULT_CLASSES =
"ariadne-flex ariadne-flex-col ariadne-min-h-screen"
Constants inherited from Component
Component::BASE_BODY_CLASSES, Component::BASE_HTML_CLASSES, Component::BASE_MAIN_CLASSES, Component::BASE_WRAPPER_CLASSES, Component::INVALID_ARIA_LABEL_TAGS
Constants included from ActionViewExtensions::FormHelper
ActionViewExtensions::FormHelper::DEFAULT_FORM_CLASSES
Constants included from Status::Dsl
Constants included from ViewHelper
Constants included from FetchOrFallbackHelper
FetchOrFallbackHelper::INTEGER_TYPES, FetchOrFallbackHelper::InvalidValueError, FetchOrFallbackHelper::TRUE_OR_FALSE
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", attributes: {}) ⇒ BodyComponent
constructor
A new instance of BodyComponent.
Methods included from ActionViewExtensions::FormHelper
Methods included from ClassNameHelper
Methods included from LoggerHelper
#logger, #silence_deprecations?, #silence_warnings?
Methods included from FetchOrFallbackHelper
#check_incoming_attribute, #check_incoming_tag, #check_incoming_value, #fetch_or_raise, #fetch_or_raise_boolean, #fetch_or_raise_integer
Constructor Details
#initialize(classes: "", attributes: {}) ⇒ BodyComponent
Returns a new instance of BodyComponent.
16 17 18 19 20 21 22 23 24 |
# File 'app/components/ariadne/body_component.rb', line 16 def initialize(classes: "", attributes: {}) @tag = :body @classes = class_names( DEFAULT_CLASSES, classes, ) @attributes = attributes end |
Instance Method Details
#call ⇒ Object
26 27 28 |
# File 'app/components/ariadne/body_component.rb', line 26 def call render(Ariadne::BaseComponent.new(tag: @tag, classes: @classes, attributes: @attributes)) { content } end |