Class: StandupMD::Section
- Inherits:
-
Object
- Object
- StandupMD::Section
- Defined in:
- lib/standup_md/section.rb
Overview
A named section of a standup entry, such as current, previous, impediments, or notes.
Instance Attribute Summary collapse
-
#tasks ⇒ Array<StandupMD::Task>
readonly
Tasks for the section.
-
#type ⇒ Symbol
readonly
The semantic section type.
Instance Method Summary collapse
-
#<<(task) ⇒ Array<StandupMD::Task>
Adds a task to the section.
-
#empty? ⇒ Boolean
Is the section empty?.
-
#initialize(type, tasks = []) ⇒ Section
constructor
Constructs an instance of
StandupMD::Section. -
#to_markdown ⇒ Array<String>
The section rendered as markdown lines.
-
#to_s ⇒ String
The configured section heading.
Constructor Details
#initialize(type, tasks = []) ⇒ Section
Constructs an instance of StandupMD::Section.
27 28 29 30 |
# File 'lib/standup_md/section.rb', line 27 def initialize(type, tasks = []) @type = type.to_sym @tasks = tasks.map { |task| build_task(task) } end |
Instance Attribute Details
#tasks ⇒ Array<StandupMD::Task> (readonly)
Tasks for the section.
20 21 22 |
# File 'lib/standup_md/section.rb', line 20 def tasks @tasks end |
#type ⇒ Symbol (readonly)
The semantic section type.
14 15 16 |
# File 'lib/standup_md/section.rb', line 14 def type @type end |
Instance Method Details
#<<(task) ⇒ Array<StandupMD::Task>
Adds a task to the section.
38 39 40 |
# File 'lib/standup_md/section.rb', line 38 def <<(task) tasks << build_task(task) end |
#empty? ⇒ Boolean
Is the section empty?
46 47 48 |
# File 'lib/standup_md/section.rb', line 46 def empty? tasks.empty? end |