Sha256: 09ae1d588cbf09656470ae5f4557cef242e8b7223d080e05c76d2f43fd97cd13

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

# frozen_string_literal: true

# File: to-null.rb

require_relative 'all-notifications'

module Macros4Cuke # Module used as a namespace
  # Namespace for all formatters of MacroCollection and MacroStep objects
  module Formatter
    # A macro-step formatter that doesn't produce any output.
    # It fully implements the expected interface of formatters but
    # its methods are NOOP (i.e. they do nothing).
    # This formatter can be useful when one wants to discard
    # any formatted output.
    class ToNull
      # Tell which notifications the formatter subscribes to.
      def implements()
        return Formatter::AllNotifications
      end

      def on_collection(_, _)
        # Do nothing
      end

      def on_collection_end(_)
        # Do nothing
      end

      def on_step(_, _)
        # Do nothing
      end

      def on_step_end(_)
        # Do nothing
      end

      def on_phrase(_, _, _)
        # Do nothing
      end

      def on_renderer(_, _)
        # Do nothing
      end

      def on_renderer_end(_)
        # Do nothing
      end

      def on_source(_, _)
        # Do nothing
      end

      def on_static_text(_, _)
        # Do nothing
      end

      def on_comment(_, _)
        # Do nothing
      end

      def on_eol(_)
        # Do nothing
      end

      def on_placeholder(_, _)
        # Do nothing
      end

      def on_section(_, _)
        # Do Nothing
      end

      def on_section_end(_)
        # Do Nothing
      end
    end # class
  end # module
end # module

# End of file

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
macros4cuke-0.5.17 lib/macros4cuke/formatter/to-null.rb