Class: CommandDeck::BasePanel
- Inherits:
-
Object
- Object
- CommandDeck::BasePanel
- Defined in:
- lib/command_deck/base_panel.rb
Overview
Base class for panel definitions.
Panels can be defined anywhere under a command_deck directory. The gem will auto-discover panels in:
- app/command_deck/**/*.rb
- packs/**/command_deck/**/*.rb
Use descriptive namespaces that match your project structure.
Example in app/command_deck/panels/global.rb:
module CommandDeck::Panels
class Global < CommandDeck::BasePanel
panel "Global Tools" do
tab "Update" do
action "Do Something", key: "global.do_something" do
perform { |params, ctx| { ok: true } }
end
end
end
end
end
Class Method Summary collapse
Class Method Details
.inherited(subclass) ⇒ Object
41 42 43 44 |
# File 'lib/command_deck/base_panel.rb', line 41 def inherited(subclass) super CommandDeck.register_panel_class(subclass) end |
.panel(title, **opts, &block) ⇒ Object
27 28 29 |
# File 'lib/command_deck/base_panel.rb', line 27 def panel(title, **opts, &block) @panel_definition = { title: title, opts: opts, block: block } end |