Class: Nitpick::Warnings::EmptyMethod

Inherits:
SimpleWarning show all
Defined in:
lib/nitpick/warnings/empty_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SimpleWarning

#==, discover

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

#bodyObject (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

Returns:

  • (Boolean)


10
11
12
# File 'lib/nitpick/warnings/empty_method.rb', line 10

def matches?
  @body == [:nil]
end

#messageObject



14
15
16
# File 'lib/nitpick/warnings/empty_method.rb', line 14

def message
  "The method #{@name.inspect} is empty."
end