Class: LintRoller::Plugin

Inherits:
Object
  • Object
show all
Defined in:
lib/lint_roller/plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Plugin

‘config’ is a Hash of options passed to the plugin by the user



4
5
6
# File 'lib/lint_roller/plugin.rb', line 4

def initialize(config = {})
  @config = config
end

Instance Method Details

#aboutObject

Raises:



8
9
10
# File 'lib/lint_roller/plugin.rb', line 8

def about
  raise Error.new("Please implement `about` and return an instance of LintRoller::About")
end

#rules(context) ⇒ Object

‘context’ is an instance of LintRoller::Context provided by the runner

Raises:



18
19
20
# File 'lib/lint_roller/plugin.rb', line 18

def rules(context)
  raise Error.new("Please implement `rules(context)` and return an instance of LintRoller::Rules")
end

#supported?(context) ⇒ Boolean

‘context’ is an instance of LintRoller::Context provided by the runner

Returns:

  • (Boolean)


13
14
15
# File 'lib/lint_roller/plugin.rb', line 13

def supported?(context)
  true
end