Class: Ui::Pagination::Component::PageItem
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Pagination::Component::PageItem
- Defined in:
- lib/uikit_rails/templates/components/pagination/component.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#html_attrs ⇒ Object
readonly
Returns the value of attribute html_attrs.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(href: "#", active: false, **html_attrs) ⇒ PageItem
constructor
A new instance of PageItem.
Constructor Details
#initialize(href: "#", active: false, **html_attrs) ⇒ PageItem
Returns a new instance of PageItem.
30 31 32 33 34 35 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 30 def initialize(href: "#", active: false, **html_attrs) @href = href @active = active @html_attrs = html_attrs super() end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
28 29 30 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 28 def active @active end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
28 29 30 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 28 def href @href end |
#html_attrs ⇒ Object (readonly)
Returns the value of attribute html_attrs.
28 29 30 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 28 def html_attrs @html_attrs end |
Instance Method Details
#call ⇒ Object
37 38 39 40 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 37 def call content_tag(:a, content, class: class_names("ui-pagination__item", "ui-pagination__item--active": active), href: href, "aria-current": ("page" if active), **html_attrs) end |