awesome-print/awesome_print

View on GitHub
lib/awesome_print/formatters/method_formatter.rb

Summary

Maintainability
A
0 mins
Test Coverage
require_relative 'base_formatter'

module AwesomePrint
  module Formatters
    class MethodFormatter < BaseFormatter

      attr_reader :method, :inspector, :options

      def initialize(method, inspector)
        @method = method
        @inspector = inspector
        @options = inspector.options
      end

      def format
        name, args, owner = method_tuple(method)

        "#{colorize(owner, :class)}##{colorize(name, :method)}#{colorize(args, :args)}"
      end
    end
  end
end