Class: Diggit::Addon Abstract
- Inherits:
-
Object
- Object
- Diggit::Addon
- 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
-
#options ⇒ Hash
readonly
The Diggit options.
Instance Method Summary collapse
-
#initialize(options) ⇒ Addon
constructor
Create a new addon.
-
#name ⇒ Symbol
abstract
Returns the name of the addon.
Constructor Details
#initialize(options) ⇒ Addon
Create a new addon.
27 28 29 |
# File 'lib/diggit_core.rb', line 27 def initialize() @options = end |
Instance Attribute Details
#options ⇒ Hash (readonly)
Returns 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 = 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
#name ⇒ Symbol
This method is abstract.
The name must be overrided.
Returns the name of the addon.
35 36 37 |
# File 'lib/diggit_core.rb', line 35 def name raise NoMethodError.new "Subclass responsability" end |