Class: Spina::Admin::Journal::ListComponent

Inherits:
ApplicationComponent show all
Defined in:
app/components/spina/admin/journal/list_component.rb

Overview

A generic implementation of a list, resembling Spina’s page list.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(list_items:, sortable: false, sort_path: '') ⇒ ListComponent

Returns a new instance of ListComponent.



10
11
12
13
14
# File 'app/components/spina/admin/journal/list_component.rb', line 10

def initialize(list_items:, sortable: false, sort_path: '')
  @sortable = sortable
  @list_items = list_items
  @sort_path = sort_path
end

Instance Attribute Details

#sortableObject (readonly)

Returns the value of attribute sortable.



8
9
10
# File 'app/components/spina/admin/journal/list_component.rb', line 8

def sortable
  @sortable
end

Instance Method Details

#sortable?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'app/components/spina/admin/journal/list_component.rb', line 16

def sortable?
  sortable
end