Class: ElementComponent::Components::Card

Inherits:
Element
  • Object
show all
Defined in:
lib/element_component/components/card.rb

Instance Attribute Summary

Attributes inherited from Element

#attributes, #contents, #element, #html

Instance Method Summary collapse

Methods inherited from Element

#add_attribute, #add_attribute!, #add_content, #add_content!, #new_element, #remove_attribute, #remove_attribute_value, #render, #reset_attributes!, #reset_contents!

Constructor Details

#initialize(**attributes) ⇒ Card

Returns a new instance of Card.



13
14
15
16
17
18
# File 'lib/element_component/components/card.rb', line 13

def initialize(**attributes, &)
  super("div", &)

  add_attribute(class: "card")
  add_attribute(attributes) unless attributes.empty?
end