Sha256: d40fc1858699ec62169c322bf637eda33f95c9c9580a9def19e352f4942d5a68

Contents?: true

Size: 399 Bytes

Versions: 3

Compression:

Stored size: 399 Bytes

Contents

# frozen_string_literal: true

module Coltrane
  module Cli
    # A text representation
    class Text < Representation
      def render
        case Cli.config.flavor
        when :marks, :notes, :degrees then @notes.pretty_names.join(' ')
        when :intervals then @notes.map { |n| (@notes.first - n).name }.join(' ')
        else raise WrongFlavorError
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
coltrane-2.2.1 lib/cli/text.rb
coltrane-2.1.5 lib/cli/text.rb
coltrane-2.1.0 lib/cli/text.rb