Sha256: 5e4e91c0dd10dba35d89f228faba0602a5c2a67777ea9f4399837a4257b33619

Contents?: true

Size: 387 Bytes

Versions: 52

Compression:

Stored size: 387 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

52 entries across 52 versions & 6 rubygems

Version Path
trusty-cms-1.0.0 lib/simpleton.rb
radiant-1.1.4 lib/simpleton.rb
radiant-1.1.3 lib/simpleton.rb
radiant-1.1.2 lib/simpleton.rb
radiant-1.1.1 lib/simpleton.rb
radiant-1.1.0 lib/simpleton.rb
radiant-1.1.0.rc1 lib/simpleton.rb
radiant-1.1.0.beta lib/simpleton.rb
radiant-1.0.1 lib/simpleton.rb
radiant-1.1.0.alpha lib/simpleton.rb
radiant-1.0.0 lib/simpleton.rb
radiant-1.0.0.rc5 lib/simpleton.rb
radiant-1.0.0.rc4 lib/simpleton.rb
radiant-1.0.0.rc3 lib/simpleton.rb
kajam-1.0.3.rc2 lib/simpleton.rb
radiant-1.0.0.rc2 lib/simpleton.rb
radiant-1.0.0.rc1 lib/simpleton.rb
radiant-rails3-0.1 lib/simpleton.rb
radiantcms-couchrest_model-0.2.4 lib/simpleton.rb
radiantcms-couchrest_model-0.2.2 lib/simpleton.rb