Class: Spina::Plugin
- Inherits:
-
Object
- Object
- Spina::Plugin
- Defined in:
- lib/spina/plugin.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
Class Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/spina/plugin.rb', line 4 def name @name end |
#namespace ⇒ Object
Returns the value of attribute namespace.
4 5 6 |
# File 'lib/spina/plugin.rb', line 4 def namespace @namespace end |
Class Method Details
.find_by_name(name) ⇒ Object
12 13 14 |
# File 'lib/spina/plugin.rb', line 12 def find_by_name(name) all.find { |plugin| plugin.name == name } end |
.register {|plugin| ... } ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/spina/plugin.rb', line 16 def register plugin = new yield plugin raise 'Missing plugin name' if plugin.name.nil? raise 'Missing plugin namespace' if plugin.namespace.nil? all << plugin plugin end |