Class: Ui::Pagination::Component::PrevItem
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Ui::Pagination::Component::PrevItem
- Defined in:
- lib/uikit_rails/templates/components/pagination/component.rb
Instance Attribute Summary collapse
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#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: "#", disabled: false, **html_attrs) ⇒ PrevItem
constructor
A new instance of PrevItem.
Constructor Details
#initialize(href: "#", disabled: false, **html_attrs) ⇒ PrevItem
Returns a new instance of PrevItem.
46 47 48 49 50 51 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 46 def initialize(href: "#", disabled: false, **html_attrs) @href = href @disabled = disabled @html_attrs = html_attrs super() end |
Instance Attribute Details
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
44 45 46 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 44 def disabled @disabled end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
44 45 46 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 44 def href @href end |
#html_attrs ⇒ Object (readonly)
Returns the value of attribute html_attrs.
44 45 46 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 44 def html_attrs @html_attrs end |
Instance Method Details
#call ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'lib/uikit_rails/templates/components/pagination/component.rb', line 53 def call classes = class_names("ui-pagination__item ui-pagination__prev", "ui-pagination__item--disabled": disabled) if disabled content_tag(:span, content.presence || "Previous", class: classes, "aria-disabled": "true", **html_attrs) else content_tag(:a, content.presence || "Previous", class: classes, href: href, **html_attrs) end end |