Class: Policial::StyleGuides::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/policial/style_guides/base.rb

Overview

Public: Base to contain common style guide logic.

Direct Known Subclasses

Ruby, Unsupported

Instance Method Summary collapse

Constructor Details

#initialize(repo_config) ⇒ Base

Returns a new instance of Base.



5
6
7
# File 'lib/policial/style_guides/base.rb', line 5

def initialize(repo_config)
  @repo_config = repo_config
end

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/policial/style_guides/base.rb', line 9

def enabled?
  @repo_config.enabled_for?(self.class)
end

#violations_in_file(_file) ⇒ Object



13
14
15
# File 'lib/policial/style_guides/base.rb', line 13

def violations_in_file(_file)
  fail NotImplementedError, "must implement ##{__method__}"
end