Class: Hato::Config::Tag

Inherits:
Object
  • Object
show all
Includes:
DSL
Defined in:
lib/hato/config.rb

Instance Attribute Summary

Attributes included from DSL

#name

Instance Method Summary collapse

Methods included from DSL

#method_missing

Constructor Details

#initialize(name, &block) ⇒ Tag

Returns a new instance of Tag.



82
83
84
85
# File 'lib/hato/config.rb', line 82

def initialize(name, &block)
  @name = name
  @block = block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hato::Config::DSL

Instance Method Details

#activate!(args = nil) ⇒ Object



87
88
89
90
# File 'lib/hato/config.rb', line 87

def activate!(args = nil)
  @plugins = []
  super(args)
end

#plugin(name, &block) ⇒ Object



96
97
98
# File 'lib/hato/config.rb', line 96

def plugin(name, &block)
  self.plugins << Plugin.new(name, &block).activate!
end

#pluginsObject



92
93
94
# File 'lib/hato/config.rb', line 92

def plugins
  @plugins ||= []
end