Class: RubocopPr::Cop
- Inherits:
-
Object
- Object
- RubocopPr::Cop
- Defined in:
- lib/rubocop_pr/cop.rb
Overview
Simple representation of the Cop
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #branch ⇒ Object
-
#initialize(name:) ⇒ Cop
constructor
A new instance of Cop.
- #to_s ⇒ Object
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
#name ⇒ Object (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
#branch ⇒ Object
14 15 16 |
# File 'lib/rubocop_pr/cop.rb', line 14 def branch "rubocop-fix-#{name.underscore.tr('/_', '-')}" end |
#to_s ⇒ Object
10 11 12 |
# File 'lib/rubocop_pr/cop.rb', line 10 def to_s name.to_s end |