Class: PhlexKit::InlineCode

Inherits:
BaseComponent show all
Defined in:
app/components/phlex_kit/typography/inline_code.rb

Overview

Inline <code>, ported from ruby_ui's RubyUI::InlineCode. Replaces the legacy code.key utility. See heading.rb (same Typography family).

Instance Method Summary collapse

Methods inherited from BaseComponent

#on

Constructor Details

#initialize(**attrs) ⇒ InlineCode

Returns a new instance of InlineCode.



5
6
7
# File 'app/components/phlex_kit/typography/inline_code.rb', line 5

def initialize(**attrs)
  @attrs = attrs
end

Instance Method Details

#view_template(&block) ⇒ Object



9
10
11
# File 'app/components/phlex_kit/typography/inline_code.rb', line 9

def view_template(&block)
  code(**mix({ class: "pk-inline-code" }, @attrs), &block)
end