Class: HTML::Pipeline::TaskList
- Inherits:
-
Object
- Object
- HTML::Pipeline::TaskList
- Defined in:
- lib/html/pipeline/task_list.rb,
lib/html/pipeline/task_list/filter.rb,
lib/html/pipeline/task_list/railtie.rb,
lib/html/pipeline/task_list/summary.rb,
lib/html/pipeline/task_list/version.rb
Overview
utilized to integrate into rails asset pipeline
Defined Under Namespace
Classes: Filter, Item, Railtie, Summary
Constant Summary collapse
- VERSION =
'0.1.0'
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Class Method Summary collapse
- .asset_paths ⇒ Object
-
.filter(*args) ⇒ Object
Returns a ‘Nokogiri::DocumentFragment` object.
- .root_path ⇒ Object
Instance Method Summary collapse
-
#initialize(record) ⇒ TaskList
constructor
‘record` is the resource with the Markdown source text with task list items following this syntax:.
-
#summary ⇒ Object
Public: return the TaskList::Summary for this task list.
Constructor Details
#initialize(record) ⇒ TaskList
‘record` is the resource with the Markdown source text with task list items following this syntax:
- [ ] a task list item
- [ ] another item
- [x] a completed item
20 21 22 |
# File 'lib/html/pipeline/task_list.rb', line 20 def initialize(record) @record = record end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
11 12 13 |
# File 'lib/html/pipeline/task_list.rb', line 11 def record @record end |
Class Method Details
.asset_paths ⇒ Object
12 13 14 |
# File 'lib/html/pipeline/task_list/railtie.rb', line 12 def asset_paths @asset_paths ||= Dir[root_path.join('app/assets/*')] end |
.filter(*args) ⇒ Object
Returns a ‘Nokogiri::DocumentFragment` object.
25 26 27 |
# File 'lib/html/pipeline/task_list/filter.rb', line 25 def self.filter(*args) Filter.call(*args) end |
.root_path ⇒ Object
8 9 10 |
# File 'lib/html/pipeline/task_list/railtie.rb', line 8 def root_path @root_path ||= Pathname.new(File.('../..', __dir__)) end |
Instance Method Details
#summary ⇒ Object
Public: return the TaskList::Summary for this task list.
Returns a TaskList::Summary.
27 28 29 |
# File 'lib/html/pipeline/task_list.rb', line 27 def summary @summary ||= HTML::Pipeline::TaskList::Summary.new(record.task_list_items) end |