Class: Components::StatBlock
- Inherits:
-
Base
- Object
- Base
- Components::StatBlock
- Defined in:
- app/components/stat_block.rb
Instance Method Summary collapse
-
#initialize(title:, value:) ⇒ StatBlock
constructor
A new instance of StatBlock.
- #view_template ⇒ Object
Constructor Details
#initialize(title:, value:) ⇒ StatBlock
Returns a new instance of StatBlock.
4 5 6 7 |
# File 'app/components/stat_block.rb', line 4 def initialize(title:, value:) @title = title @value = value end |
Instance Method Details
#view_template ⇒ Object
9 10 11 12 13 14 |
# File 'app/components/stat_block.rb', line 9 def view_template div(class: "badge text-bg-info col me-2") do div { @title.respond_to?(:model_name) ? @title.model_name.human(count: 100) : @title.to_s } div(class: "fs-4 mt-2 ") { @value.to_s } end end |