Sha256: cec56e0e9fa35d40f75f902fbff42036505bd809007527c6a96135d32ea19dd5

Contents?: true

Size: 501 Bytes

Versions: 27

Compression:

Stored size: 501 Bytes

Contents

require 'singleton'

module Stove
  module Mixin::Instanceable
    def self.included(base)
      base.send(:include, Singleton)
      base.send(:extend, ClassMethods)
    end

    def self.extended(base)
      base.send(:include, Singleton)
      base.send(:extend, ClassMethods)
    end

    module ClassMethods
      def to_s; instance.to_s; end
      def inspect; instance.inspect; end

      def method_missing(m, *args, &block)
        instance.send(m, *args, &block)
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 3 rubygems

Version Path
chef-stove-7.1.6 lib/stove/mixins/instanceable.rb
stove-7.1.6 lib/stove/mixins/instanceable.rb
chef-stove-7.1.5 lib/stove/mixins/instanceable.rb
stove-7.1.5 lib/stove/mixins/instanceable.rb
chef-stove-7.1.1 lib/stove/mixins/instanceable.rb
stove-7.1.0 lib/stove/mixins/instanceable.rb
stove-7.0.1 lib/stove/mixins/instanceable.rb
stove-7.0.0 lib/stove/mixins/instanceable.rb
stove-6.1.1 lib/stove/mixins/instanceable.rb
stove-6.1.0 lib/stove/mixins/instanceable.rb
stove-6.0.0 lib/stove/mixins/instanceable.rb
stove-5.2.0 lib/stove/mixins/instanceable.rb
stove-5.1.0 lib/stove/mixins/instanceable.rb
stove-5.0.0 lib/stove/mixins/instanceable.rb
stove-4.1.1 lib/stove/mixins/instanceable.rb
stove-4.1.0 lib/stove/mixins/instanceable.rb
stove-4.0.0 lib/stove/mixins/instanceable.rb
stove-3.2.8 lib/stove/mixins/instanceable.rb
wood-stove-3.2.9000 lib/stove/mixins/instanceable.rb
stove-3.2.7 lib/stove/mixins/instanceable.rb