Sha256: 89f4fb544aa6a73394d71cfa69c59a215e28301e5efe60c1da79066b6330d8b4

Contents?: true

Size: 366 Bytes

Versions: 71

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

71 entries across 71 versions & 1 rubygems

Version Path
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
trusty-cms-6.0.3 lib/simpleton.rb
trusty-cms-6.0.2 lib/simpleton.rb
trusty-cms-6.0.1 lib/simpleton.rb
trusty-cms-5.6.1 lib/simpleton.rb
trusty-cms-6.0.0 lib/simpleton.rb
trusty-cms-5.6.0 lib/simpleton.rb
trusty-cms-5.5.9 lib/simpleton.rb
trusty-cms-5.5.8 lib/simpleton.rb