Class: RubocopPr::Cop

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop_pr/cop.rb

Overview

Simple representation of the Cop

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:) ⇒ Cop

Returns a new instance of Cop.



6
7
8
# File 'lib/rubocop_pr/cop.rb', line 6

def initialize(name:)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/rubocop_pr/cop.rb', line 4

def name
  @name
end

Instance Method Details

#branchObject



14
15
16
# File 'lib/rubocop_pr/cop.rb', line 14

def branch
  "rubocop-fix-#{name.underscore.tr('/_', '-')}"
end

#to_sObject



10
11
12
# File 'lib/rubocop_pr/cop.rb', line 10

def to_s
  name.to_s
end