Sha256: a647b90c6f313e4e76122c72e93b03b22a0f6937a9fc37dbcd38d222140d8f33

Contents?: true

Size: 484 Bytes

Versions: 8

Compression:

Stored size: 484 Bytes

Contents

# frozen_string_literal: true

module SublimeTextKit
  module Snippets
    # Prints snippets as a list.
    class Printer
      include Import[:io]

      def initialize(collector: Collector.new, **)
        super(**)
        @collector = collector
      end

      def call bullet
        collector.call.each do |snippet|
          io.puts "#{bullet} #{snippet.description} - `#{snippet.trigger}`"
        end
      end

      private

      attr_reader :collector
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sublime_text_kit-17.6.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.5.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.4.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.3.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.2.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.1.0 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.0.1 lib/sublime_text_kit/snippets/printer.rb
sublime_text_kit-17.0.0 lib/sublime_text_kit/snippets/printer.rb