Class: Plugin

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

Direct Known Subclasses

CheckerPlugin, CheckerSpelling, StatsPlugin

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(infos = {}) ⇒ Plugin


7
8
9
# File 'lib/common/plugins/plugin.rb', line 7

def initialize(infos = {})
  @author  = infos[:author]
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author


5
6
7
# File 'lib/common/plugins/plugin.rb', line 5

def author
  @author
end

#registered_optionsObject (readonly)

Returns the value of attribute registered_options


5
6
7
# File 'lib/common/plugins/plugin.rb', line 5

def registered_options
  @registered_options
end

Instance Method Details

#register_options(*options) ⇒ Object

param Array options


16
17
18
19
20
21
22
23
# File 'lib/common/plugins/plugin.rb', line 16

def register_options(*options)
  options.each do |option|
    unless option.is_a?(Array)
      raise "Each option must be an array, #{option.class} supplied"
    end
  end
  @registered_options = options
end

#run(options = {}) ⇒ Object

Raises:

  • (NotImplementedError)

11
12
13
# File 'lib/common/plugins/plugin.rb', line 11

def run(options = {})
  raise NotImplementedError
end