Class: ElementComponent::Components::Pagination

Inherits:
Element
  • Object
show all
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

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