Sha256: 31ed21224700ac56780eb5d811e523f5b93b9ac30483e289144c06c80b0dc423

Contents?: true

Size: 579 Bytes

Versions: 15

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

module Coltrane
  module Cli
    # Interfaces notes outputting functionality with the lib
    class Notes
      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

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

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
coltrane-2.0.0 lib/cli/notes.rb
coltrane-1.2.4 lib/cli/notes.rb
coltrane-1.2.3 lib/cli/notes.rb
coltrane-1.2.2 lib/cli/notes.rb
coltrane-1.2.1 lib/cli/notes.rb
coltrane-1.2.0 lib/cli/notes.rb
coltrane-1.1.2 lib/cli/notes.rb
coltrane-1.1.1 lib/cli/notes.rb
coltrane-1.1.0 lib/cli/notes.rb
coltrane-1.0.26 lib/cli/notes.rb
coltrane-1.0.24 lib/cli/notes.rb
coltrane-1.0.22 lib/cli/notes.rb
coltrane-1.0.21 lib/cli/notes.rb
coltrane-1.0.20 lib/cli/notes.rb
coltrane-1.0.2 lib/cli/notes.rb