Module: StandupMD::Cli::Helpers

Included in:
StandupMD::Cli
Defined in:
lib/standup_md/cli/helpers.rb

Overview

Module responsible for reading and writing standup files.

Instance Method Summary collapse

Instance Method Details

Print an entry to the command line.

Parameters:

Returns:

  • (nil)


14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/standup_md/cli/helpers.rb', line 14

def print(entry)
  return puts "No record found for #{config.cli.date}" if entry.nil?

  puts header(entry)
  config.file.sub_header_order.each do |header_type|
    tasks = entry.public_send(header_type)
    next if !tasks || tasks.empty?

    puts sub_header(header_type)
    tasks.each { |task| puts "#{config.file.bullet_character} #{task}" }
  end
  puts
end