class CC::Service::Formatter

Attributes

options[R]

Public Class Methods

new(service, options = {}) click to toggle source
Calls superclass method
# File lib/cc/service/formatter.rb, line 6
def initialize(service, options = {})
  super(service)

  @options = {
    prefix: "[Code Climate]",
    prefix_with_repo: true,
  }.merge(options)
end

Private Instance Methods

message_prefix() click to toggle source
# File lib/cc/service/formatter.rb, line 21
def message_prefix
  prefix = options.fetch(:prefix, "").to_s

  if options[:prefix_with_repo]
    prefix << "[#{repo_name}]"
  end

  unless prefix.empty?
    prefix << " "
  end

  prefix
end
service_title() click to toggle source
# File lib/cc/service/formatter.rb, line 17
def service_title
  __getobj__.class.title
end