Class: Panda::Core::Admin::CodeBlockComponent
- Defined in:
- app/components/panda/core/admin/code_block_component.rb
Overview
Code block component for snippets and examples.
Constant Summary
Constants inherited from Base
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
- #default_attrs ⇒ Object
-
#initialize(code: nil, **attrs) ⇒ CodeBlockComponent
constructor
A new instance of CodeBlockComponent.
Constructor Details
#initialize(code: nil, **attrs) ⇒ CodeBlockComponent
Returns a new instance of CodeBlockComponent.
8 9 10 11 |
# File 'app/components/panda/core/admin/code_block_component.rb', line 8 def initialize(code: nil, **attrs) @code = code super(**attrs) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
13 14 15 |
# File 'app/components/panda/core/admin/code_block_component.rb', line 13 def code @code end |
Instance Method Details
#default_attrs ⇒ Object
15 16 17 18 19 |
# File 'app/components/panda/core/admin/code_block_component.rb', line 15 def default_attrs { class: "rounded-xl bg-gray-900/95 p-3 text-xs text-emerald-200 font-mono overflow-x-auto" } end |