Module: ChefWorkflow::GenericSupport

Included in:
EC2Support, GeneralSupport, IPSupport, KnifeSupport, VagrantSupport
Defined in:
lib/chef-workflow/support/generic.rb

Overview

mixin for supplying a consistent interface to singleton configuration classes.

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/chef-workflow/support/generic.rb', line 10

def self.included(klass)
  klass.instance_eval do
    include Singleton

    def self.configure(&block)
      instance.instance_eval(&block) if block
    end

    def self.method_missing(sym, *args)
      instance.send(sym, *args)
    end

    def self.singleton
      instance
    end

    class << self
      include Deprecated
    end

    self.singleton_class.deprecated :singleton, "#{klass.name} class methods"
  end
end