Module: Naplug::ClassMethods

Defined in:
lib/naplug.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.pluginsObject (readonly)

Returns the value of attribute plugins.



26
27
28
# File 'lib/naplug.rb', line 26

def plugins
  @plugins
end

Class Method Details

.plugin(*tagmeta, &block) ⇒ Plugin

Create a metaplugin (which basically contains a tag and a block)

Parameters:

  • tag (Symbol)

    the plugin tag

Returns:



31
32
33
34
35
# File 'lib/naplug.rb', line 31

def plugin(*tagmeta, &block)
  tag, meta = tagmeta_grok tagmeta
  @plugins = Hash.new unless @plugins
  @plugins[tag] = create_metaplugin tag, meta, block
end

.tagsArray<Symbol>

A list of plugin tags

Returns:

  • (Array<Symbol>)

    the list of plugin tags



39
40
41
# File 'lib/naplug.rb', line 39

def tags
  self.plugins.keys
end