Sha256: eced2f2c5fc24e76cc5b79a840b0fa48fa397528cb72adaba952d15b75e36563

Contents?: true

Size: 520 Bytes

Versions: 3

Compression:

Stored size: 520 Bytes

Contents

require 'singleton'

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

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stove-2.0.0 lib/stove/mixins/instanceable.rb
stove-2.0.0.beta.2 lib/stove/mixins/instanceable.rb
stove-2.0.0.beta.1 lib/stove/mixins/instanceable.rb