Sha256: d0ae35fcecc463b1bc24b17c55662469374bcaa7cb76fea85b1881190353187f

Contents?: true

Size: 342 Bytes

Versions: 3

Compression:

Stored size: 342 Bytes

Contents

# frozen_string_literal: true

module Motoko
  module Formatters
    class BaseFormatter
      def initialize(options = {}) end

      def format(value)
        case value
        when Array
          value.join("\n")
        when Hash
          value.keys.join("\n")
        else
          value.to_s
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
motoko-1.2.0 lib/motoko/formatters/base_formatter.rb
motoko-1.1.0 lib/motoko/formatters/base_formatter.rb
motoko-1.0.0 lib/motoko/formatters/base_formatter.rb