Sha256: c8e09e40eb94aa80dab39c9982e03005e63201eb6ba4efb91719f174d8230439

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

module Helium
  class Console
    define_formatter_for String do
      def call
        light_green(Helium::Console.format_string(
          object.dump.gsub('\n', "\n"),
          max_width: max_width,
          max_lines: max_lines,
          overflow: overflow,
          ellipses: "...\""
        ))
      end

      def max_lines
        return options[:max_lines] if options[:max_lines]
        case level
        when 1 then nil
        when 2 then 3
        else 1
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
helium-console-0.1.3 lib/helium/console/registry/string.rb