Class: Diggit::Addon Abstract

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

Overview

This class is abstract.

Subclass and override name to implement custom Diggit addons.

Base class for Diggit addons.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Addon

Create a new addon.

Parameters:

  • options (Hash)

    a hash containing the Diggit options.



27
28
29
# File 'lib/diggit_core.rb', line 27

def initialize(options)
	@options = options
end

Instance Attribute Details

#optionsHash (readonly)

Returns the Diggit options.

Returns:

  • (Hash)

    the Diggit options.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/diggit_core.rb', line 22

class Addon

	# Create a new addon.
	#
	# @param options [Hash] a hash containing the Diggit options.
	def initialize(options)
		@options = options
	end

	# Returns the name of the addon.
	# @abstract The name must be overrided.
	#
	# @return [Symbol] the name of the addon.
	def name
		raise NoMethodError.new "Subclass responsability"
	end

end

Instance Method Details

#nameSymbol

This method is abstract.

The name must be overrided.

Returns the name of the addon.

Returns:

  • (Symbol)

    the name of the addon.



35
36
37
# File 'lib/diggit_core.rb', line 35

def name
	raise NoMethodError.new "Subclass responsability"
end