Class: Spark::Checklist
- Inherits:
-
Spark::Component::Base
- Object
- ActionView::Component::Base
- Spark::Component::Base
- Spark::Checklist
- Defined in:
- app/components/spark/checklist.rb,
app/components/spark/checklist/item.rb,
app/components/spark/checklist/trigger.rb,
app/components/spark/checklist/container.rb
Defined Under Namespace
Classes: Container, Item, Trigger
Instance Method Summary collapse
-
#initialize ⇒ Checklist
constructor
A new instance of Checklist.
- #sort_items ⇒ Object
Methods inherited from Spark::Component::Base
Constructor Details
#initialize ⇒ Checklist
Returns a new instance of Checklist.
10 11 12 13 14 15 |
# File 'app/components/spark/checklist.rb', line 10 def initialize(*) super data.add checklist_id: unique_id classname.base = 'spark-checklist-container' end |
Instance Method Details
#sort_items ⇒ Object
17 18 19 20 21 |
# File 'app/components/spark/checklist.rb', line 17 def sort_items items.sort_by! { |item| item.attribute_completed ? 1 : 0 } add_collapse_item_class if @collapse_after items end |