Sha256: ce0546105c475a1d4080fa1c7806c89df9179ccad6646e5c0fc3f01515ebf041

Contents?: true

Size: 571 Bytes

Versions: 22

Compression:

Stored size: 571 Bytes

Contents

module Coltrane
  module Renderers
    module TextRenderer
      class TheoryProgressionSetDrawer < BaseDrawer
        alias progression_set model

        def render
          progression_set.map do |progression|
            "#{progression.notation.ljust(notation_width + 1, ' ')} in " \
            "#{progression.scale} (#{progression.notes_out.size} notes out)"
          end
          .join("\n")
        end

        def notation_width
          @notation_width ||=
            progression_set.map(&:notation).map(&:size).max
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
coltrane-4.1.2 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.1.1 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.1.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.0.6 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.0.5 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.0.4 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-4.0.3 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.4.2 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.4.1 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.4.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.3.3 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.3.2 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.3.1 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.3.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.2.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.1.3 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.1.2 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.1.1 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.1.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb
coltrane-3.0.0 lib/coltrane/renderers/text_renderer/theory_progression_set_drawer.rb