Class: Groseillier::Addon
- Inherits:
-
Object
- Object
- Groseillier::Addon
- Defined in:
- lib/groseillier/addon.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#description ⇒ Object
Returns the internationalized version of the description.
- #menu ⇒ Object
-
#name ⇒ Object
Return the name of the addon.
-
#title ⇒ Object
Returns the internationalized version of the title.
- #translate(property) ⇒ Object
Instance Attribute Details
#engine ⇒ Object
Returns the value of attribute engine.
3 4 5 |
# File 'lib/groseillier/addon.rb', line 3 def engine @engine end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/groseillier/addon.rb', line 3 def version @version end |
Class Method Details
.register {|addon = self.new| ... } ⇒ Object
5 6 7 8 9 10 |
# File 'lib/groseillier/addon.rb', line 5 def self.register(&block) yield(addon = self.new) # Add the new addon to the collection of registered addons ::Groseillier::Addons.registered << addon end |
Instance Method Details
#description ⇒ Object
Returns the internationalized version of the description
23 24 25 |
# File 'lib/groseillier/addon.rb', line 23 def description translate('description') end |
#menu ⇒ Object
27 28 29 |
# File 'lib/groseillier/addon.rb', line 27 def translate('menu') end |
#name ⇒ Object
Return the name of the addon
13 14 15 |
# File 'lib/groseillier/addon.rb', line 13 def name engine.engine_name end |
#title ⇒ Object
Returns the internationalized version of the title
18 19 20 |
# File 'lib/groseillier/addon.rb', line 18 def title translate('title') end |
#translate(property) ⇒ Object
31 32 33 |
# File 'lib/groseillier/addon.rb', line 31 def translate(property) ::I18n.translate(['groseillier', 'addons', name, property].join('.')) end |