Class: Cmdk::Separator
Overview
Visual and semantic separator. Port of ‘<Command.Separator>`. Hidden by the runtime while a search query is present, unless `always_render:`.
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize(always_render: false, **attributes) ⇒ Separator
constructor
A new instance of Separator.
- #view_template ⇒ Object
Constructor Details
#initialize(always_render: false, **attributes) ⇒ Separator
Returns a new instance of Separator.
5 6 7 8 |
# File 'lib/cmdk/separator.rb', line 5 def initialize(always_render: false, **attributes) @always_render = always_render @attributes = attributes end |
Instance Method Details
#view_template ⇒ Object
10 11 12 13 14 |
# File 'lib/cmdk/separator.rb', line 10 def view_template defaults = { 'cmdk-separator' => '', role: 'separator' } defaults[:data] = { cmdk_always_render: '' } if @always_render div(**merged(defaults, @attributes)) end |