Sha256: e733c9ebbf9a7e988c0e1c099a4f598b07a9f4572f400d6cdcf9ba4d3e142124

Contents?: true

Size: 389 Bytes

Versions: 15

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module Coltrane
  module Cli
    # A text representation
    class Text < Representation
      def render
        case @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

15 entries across 15 versions & 1 rubygems

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