Class: Coltrane::Cli::Notes

Inherits:
Object
  • Object
show all
Defined in:
lib/cli/notes.rb

Overview

Interfaces notes outputting functionality with the lib

Instance Method Summary collapse

Constructor Details

#initialize(notes, on: 'text', desc: nil, flavor: 'notes') ⇒ Notes

Returns a new instance of Notes.



7
8
9
10
11
12
13
14
# File 'lib/cli/notes.rb', line 7

def initialize(notes, on: 'text', desc: nil, flavor: 'notes')
  @desc   = desc || 'The notes you supplied:'
  flavor  = flavor.underscore.to_sym
  on      = on.to_sym
  notes   = Coltrane::NoteSet.new(notes)
  @representation = Representation.build(on, notes, flavor)
  render
end

Instance Method Details

#renderObject



16
17
18
# File 'lib/cli/notes.rb', line 16

def render
  puts "\n" + [@desc, @representation.render].join("\n" * 2)
end