Sha256: 89f4fb544aa6a73394d71cfa69c59a215e28301e5efe60c1da79066b6330d8b4

Contents?: true

Size: 366 Bytes

Versions: 79

Compression:

Stored size: 366 Bytes

Contents

module Simpleton
  def self.included(base)
    base.extend(ClassMethods)
  end

  module ClassMethods
    def instance(&block)
      @instance ||= new
      block.call(@instance) if block_given?
      @instance
    end

    def method_missing(method, *args, &block)
      instance.respond_to?(method) ? instance.send(method, *args, &block) : super
    end
  end
end

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
trusty-cms-7.0.10 lib/simpleton.rb
trusty-cms-7.0.9 lib/simpleton.rb
trusty-cms-7.0.8 lib/simpleton.rb
trusty-cms-7.0.7 lib/simpleton.rb
trusty-cms-7.0.6 lib/simpleton.rb
trusty-cms-7.0.5 lib/simpleton.rb
trusty-cms-7.0.4 lib/simpleton.rb
trusty-cms-7.0.3 lib/simpleton.rb
trusty-cms-6.3.1 lib/simpleton.rb
trusty-cms-7.0.2 lib/simpleton.rb
trusty-cms-7.0.1 lib/simpleton.rb
trusty-cms-7.0.0 lib/simpleton.rb
trusty-cms-6.3 lib/simpleton.rb
trusty-cms-6.2.1 lib/simpleton.rb
trusty-cms-6.2.2.1 lib/simpleton.rb
trusty-cms-6.2.0 lib/simpleton.rb
trusty-cms-6.1.2 lib/simpleton.rb
trusty-cms-6.1.1 lib/simpleton.rb
trusty-cms-6.0.5 lib/simpleton.rb
trusty-cms-6.0.4 lib/simpleton.rb