Class List Method List File List

# Class: Plugin

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

## Direct Known Subclasses

CheckerPlugin, ListGeneratorPlugin, StatsPlugin

## Instance Attribute Summary (collapse)

- - (Object) author readonly

  Returns the value of attribute author.

- - (Object) registered_options readonly

  Returns the value of attribute registered_options.

## Instance Method Summary (collapse)

- - (Plugin) initialize(infos = {}) constructor

  A new instance of Plugin.

- - (Object) register_options(*options)

  param Array options.

- - (Object) run(options = {})

## Constructor Details

### - (`Plugin`) initialize(infos = {})

A new instance of Plugin

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

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

## Instance Attribute Details

### - (`Object`) author (readonly)

Returns the value of attribute author

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

    def author
      @author
    end

### - (`Object`) registered_options (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

### - (`Object`) register_options(*options)

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

### - (`Object`) run(options = {})

Raises:

- (`NotImplementedError`)

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

    def run(options = {})
      raise NotImplementedError
    end