Class: MetadataCop::Cop::BaseCop
- Inherits:
-
Object
- Object
- MetadataCop::Cop::BaseCop
- Defined in:
- lib/metadatacop/cop/base_cop.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ BaseCop
constructor
A new instance of BaseCop.
- #lint? ⇒ Boolean
- #message(params = {}) ⇒ Object
- #offense(message) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ BaseCop
Returns a new instance of BaseCop.
6 7 8 |
# File 'lib/metadatacop/cop/base_cop.rb', line 6 def initialize( = {}) = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/metadatacop/cop/base_cop.rb', line 4 def end |
Instance Method Details
#lint? ⇒ Boolean
14 15 16 |
# File 'lib/metadatacop/cop/base_cop.rb', line 14 def lint? self.class.to_s =~ /Lint/ end |
#message(params = {}) ⇒ Object
10 11 12 |
# File 'lib/metadatacop/cop/base_cop.rb', line 10 def (params = {}) self.class::MSG % params end |
#offense(message) ⇒ Object
18 19 20 |
# File 'lib/metadatacop/cop/base_cop.rb', line 18 def offense() MetadataCop::Offense.new(cop: self.class, message: ) end |