Class: Nitpick::Warnings::EmptyMethod
- Inherits:
-
SimpleWarning
- Object
- SimpleWarning
- Nitpick::Warnings::EmptyMethod
- Defined in:
- lib/nitpick/warnings/empty_method.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
-
#initialize(*args) ⇒ EmptyMethod
constructor
A new instance of EmptyMethod.
- #matches? ⇒ Boolean
- #message ⇒ Object
Methods inherited from SimpleWarning
Constructor Details
#initialize(*args) ⇒ EmptyMethod
Returns a new instance of EmptyMethod.
6 7 8 |
# File 'lib/nitpick/warnings/empty_method.rb', line 6 def initialize(*args) @name, @args, @body = args end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/nitpick/warnings/empty_method.rb', line 4 def body @body end |
Instance Method Details
#matches? ⇒ Boolean
10 11 12 |
# File 'lib/nitpick/warnings/empty_method.rb', line 10 def matches? @body == [:nil] end |
#message ⇒ Object
14 15 16 |
# File 'lib/nitpick/warnings/empty_method.rb', line 14 def "The method #{@name.inspect} is empty." end |