Class: TaskList
- Inherits:
-
Object
- Object
- TaskList
- Defined in:
- lib/task_list.rb,
lib/task_list/filter.rb,
lib/task_list/railtie.rb,
lib/task_list/summary.rb,
lib/task_list/version.rb
Overview
encoding: utf-8
Defined Under Namespace
Classes: Filter, Item, Railtie, Summary
Constant Summary collapse
- VERSION =
[2, 3, 4].join('.')
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
15 16 17 |
# File 'lib/task_list.rb', line 15 def initialize(record) @record = record end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
6 7 8 |
# File 'lib/task_list.rb', line 6 def record @record end |
Class Method Details
.asset_paths ⇒ Object
7 8 9 |
# File 'lib/task_list/railtie.rb', line 7 def self.asset_paths @paths ||= Dir[root_path.join("app/assets/*")] end |
.filter(*args) ⇒ Object
Returns a ‘Nokogiri::DocumentFragment` object.
7 8 9 |
# File 'lib/task_list/filter.rb', line 7 def self.filter(*args) Filter.call(*args) end |
.root_path ⇒ Object
3 4 5 |
# File 'lib/task_list/railtie.rb', line 3 def self.root_path @root_path ||= Pathname.new(File.("../../../", __FILE__)) end |