Class: Mobility::Plugin::DependencyResolver::DSL

Inherits:
BasicObject
Defined in:
lib/mobility/plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(plugins, defaults) ⇒ DSL

Returns a new instance of DSL.



244
245
246
247
# File 'lib/mobility/plugin.rb', line 244

def initialize(plugins, defaults)
  @plugins = plugins
  @defaults = defaults
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



249
250
251
252
253
# File 'lib/mobility/plugin.rb', line 249

def method_missing(m, *args)
  plugin = Plugins.load_plugin(m)
  @plugins << plugin
  plugin.configure_default(@defaults, m, *args)
end

Class Method Details

.call(defaults, &block) ⇒ Object



239
240
241
242
# File 'lib/mobility/plugin.rb', line 239

def self.call(defaults, &block)
  new(plugins = ::Set.new, defaults).instance_eval(&block)
  plugins
end