Class: Groseillier::Addon

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#engineObject

Returns the value of attribute engine.



3
4
5
# File 'lib/groseillier/addon.rb', line 3

def engine
  @engine
end

#versionObject

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

Yields:

  • (addon = self.new)


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

#descriptionObject

Returns the internationalized version of the description



23
24
25
# File 'lib/groseillier/addon.rb', line 23

def description
  translate('description')
end


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

def menu
  translate('menu')
end

#nameObject

Return the name of the addon



13
14
15
# File 'lib/groseillier/addon.rb', line 13

def name
  engine.engine_name
end

#titleObject

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