Class: ElementComponent::Components::Pagination
- Defined in:
- lib/element_component/components/pagination.rb
Constant Summary collapse
- VALID_SIZES =
%i[sm lg].freeze
Instance Attribute Summary
Attributes inherited from Element
#attributes, #contents, #element, #html
Instance Method Summary collapse
-
#initialize(size: nil, **attributes, &block) ⇒ Pagination
constructor
A new instance of Pagination.
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(size: nil, **attributes, &block) ⇒ Pagination
Returns a new instance of Pagination.
10 11 12 13 14 15 16 |
# File 'lib/element_component/components/pagination.rb', line 10 def initialize(size: nil, **attributes, &block) @pagination_size = size super("nav", &block) add_attribute("aria-label": "Pagination") add_attribute(attributes) unless attributes.empty? end |