Class: Primer::BoxComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/primer/box_component.rb

Overview

A basic wrapper component for most layout related needs.

Constant Summary

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Instance Method Summary collapse

Methods included from JoinStyleArgumentsHelper

#join_style_arguments

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(**system_arguments) ⇒ BoxComponent

Returns a new instance of BoxComponent.

Parameters:

  • system_arguments (Hash)

    <%= link_to_system_arguments_docs %>



7
8
9
10
# File 'app/components/primer/box_component.rb', line 7

def initialize(**system_arguments)
  @system_arguments = system_arguments
  @system_arguments[:tag] = :div
end

Instance Method Details

#callObject



12
13
14
# File 'app/components/primer/box_component.rb', line 12

def call
  render(Primer::BaseComponent.new(**@system_arguments)) { content }
end