Class: RJSV::Plugin

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

Overview

Abstract ‘class’ for creating initialization plagins. They are teachable for defining basic information and is the starting point for triggering functions using the init() function. If we are creating a custom plugin, we need to inherit this ‘class’ into its own ‘class’.

Instance Method Summary collapse

Instance Method Details

#argumentsObject

The method should pass an initialization method for all arguments of this plugin.



31
32
33
# File 'lib/rjsv/plugin.rb', line 31

def arguments
  abstract_error('arguments()')
end

#descriptionObject

Description of the plugin that is printed to the CLI during help.



14
15
16
# File 'lib/rjsv/plugin.rb', line 14

def description
  abstract_error('description()')
end

#initObject

The method that is the main initialization block for the code that the plugin should execute.



40
41
42
# File 'lib/rjsv/plugin.rb', line 40

def init
  abstract_error('init()')
end

#nameObject

This function is not mandatory and automatically defines the ‘module’ name according to the plugin ‘module’.



23
24
25
# File 'lib/rjsv/plugin.rb', line 23

def name
  self.class.name.split('::')[-2].downcase
end