Module: Naplug::ClassMethods
- Includes:
- Helpers::Grokkers
- Defined in:
- lib/naplug.rb
Class Attribute Summary collapse
-
._time ⇒ Object
readonly
Returns the value of attribute _time.
-
.plugins ⇒ Hash<Symbol, Plugin>
readonly
Metaplugins.
Class Method Summary collapse
- .meta(m) ⇒ Object
-
.plugin(*tagmeta, &block) ⇒ Plugin
Create a metaplugin (which basically contains a tag and a block).
-
.tags ⇒ Array<Symbol>
A list of plugin tags.
Methods included from Helpers::Grokkers
Class Attribute Details
._time ⇒ Object (readonly)
Returns the value of attribute _time.
30 31 32 |
# File 'lib/naplug.rb', line 30 def _time @_time end |
.plugins ⇒ Hash<Symbol, Plugin> (readonly)
Returns metaplugins.
30 31 32 |
# File 'lib/naplug.rb', line 30 def plugins @plugins end |
Class Method Details
.meta(m) ⇒ Object
44 45 46 |
# File 'lib/naplug.rb', line 44 def (m) @_time = { :start => Time.now } # if m[:benchmark] end |
.plugin(*tagmeta, &block) ⇒ Plugin
Create a metaplugin (which basically contains a tag and a block)
35 36 37 38 39 40 41 42 |
# File 'lib/naplug.rb', line 35 def plugin(*, &block) tag, = @metas = Hash.new unless @metas @metas[tag] = Meta.new .merge :meta => true @plugins = Hash.new unless @plugins @plugins[tag] = tag, , block @_time = { :start => Time.now } # if m[:benchmark] end |
.tags ⇒ Array<Symbol>
A list of plugin tags
50 51 52 |
# File 'lib/naplug.rb', line 50 def self.plugins.keys end |