Class: Clacky::UI2::Components::BaseComponent
- Inherits:
-
Object
- Object
- Clacky::UI2::Components::BaseComponent
- Defined in:
- lib/clacky/ui2/components/base_component.rb
Overview
BaseComponent provides common functionality for all UI components
Direct Known Subclasses
CommonComponent, MessageComponent, ModalComponent, ToolComponent
Class Method Summary collapse
-
.render(data) ⇒ String
Class method to render without instantiating.
Instance Method Summary collapse
-
#initialize ⇒ BaseComponent
constructor
A new instance of BaseComponent.
-
#render(data) ⇒ String
Render component with given data.
Constructor Details
#initialize ⇒ BaseComponent
Returns a new instance of BaseComponent.
10 11 12 |
# File 'lib/clacky/ui2/components/base_component.rb', line 10 def initialize @pastel = Pastel.new end |
Class Method Details
.render(data) ⇒ String
Class method to render without instantiating
24 25 26 |
# File 'lib/clacky/ui2/components/base_component.rb', line 24 def self.render(data) new.render(data) end |
Instance Method Details
#render(data) ⇒ String
Render component with given data
17 18 19 |
# File 'lib/clacky/ui2/components/base_component.rb', line 17 def render(data) raise NotImplementedError, "Subclasses must implement render method" end |