Class: MethodIndentation
- Inherits:
-
Object
- Object
- MethodIndentation
- Defined in:
- lib/rules/method_indentation.rb
Constant Summary collapse
- TABS =
2
Instance Method Summary collapse
-
#initialize(max) ⇒ MethodIndentation
constructor
A new instance of MethodIndentation.
- #message ⇒ Object
- #valid?(method) ⇒ Boolean
Constructor Details
#initialize(max) ⇒ MethodIndentation
Returns a new instance of MethodIndentation.
4 5 6 |
# File 'lib/rules/method_indentation.rb', line 4 def initialize(max) @max = max + 2 # including class and def indent end |
Instance Method Details
#message ⇒ Object
12 13 14 |
# File 'lib/rules/method_indentation.rb', line 12 def "indentation is more than #{@max} levels" end |
#valid?(method) ⇒ Boolean
8 9 10 |
# File 'lib/rules/method_indentation.rb', line 8 def valid?(method) max_indent(method) <= @max end |