Class: Oversee::Card
- Inherits:
-
Phlex::HTML
- Object
- Phlex::HTML
- Oversee::Card
- Defined in:
- app/components/oversee/card.rb
Instance Method Summary collapse
-
#initialize(card_name:) ⇒ Card
constructor
A new instance of Card.
- #view_template ⇒ Object
Constructor Details
#initialize(card_name:) ⇒ Card
Returns a new instance of Card.
2 3 4 5 |
# File 'app/components/oversee/card.rb', line 2 def initialize(card_name:) @card_name = card_name @card = card_name.constantize.new end |
Instance Method Details
#view_template ⇒ Object
7 8 9 10 11 12 |
# File 'app/components/oversee/card.rb', line 7 def view_template div(class: "bg-gray-100 rounded-md p-4") do p(class: "text-xs uppercase text-gray-600") { @card.label } h4(class: "mt-2 text-gray-900 text-2xl") { @card.value } end end |