Class: Diggit::Plugin Abstract

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

Overview

This class is abstract.

Abstract superclass for all plugins.

Base class for plugins. They have associated options.

Direct Known Subclasses

Addon, Runnable

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Plugin

Returns a new instance of Plugin.



32
33
34
# File 'lib/dgit/plugins.rb', line 32

def initialize(options)
	@options = options
end

Instance Attribute Details

#optionsHash<String, Object> (readonly)

Returns the hash of options.

Returns:

  • (Hash<String, Object>)

    the hash of options.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/dgit/plugins.rb', line 29

class Plugin
	attr_reader :options

	def initialize(options)
		@options = options
	end

	def name
		self.class.name
	end

	def self.name
		to_s.underscore
	end
end

Class Method Details

.nameObject



40
41
42
# File 'lib/dgit/plugins.rb', line 40

def self.name
	to_s.underscore
end

Instance Method Details

#nameObject



36
37
38
# File 'lib/dgit/plugins.rb', line 36

def name
	self.class.name
end