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
radiantcms-couchrest_model-0.2.1 lib/simpleton.rb
radiantcms-couchrest_model-0.2 lib/simpleton.rb
radiantcms-couchrest_model-0.1.9 lib/simpleton.rb
radiantcms-couchrest_model-0.1.8 lib/simpleton.rb
radiantcms-couchrest_model-0.1.7 lib/simpleton.rb
radiantcms-couchrest_model-0.1.6 lib/simpleton.rb
radiantcms-couchrest_model-0.1.5 lib/simpleton.rb
radiantcms-couchrest_model-0.1.4 lib/simpleton.rb
radiantcms-couchrest_model-0.1.3 lib/simpleton.rb
radiantcms-couchrest_model-0.1.2 lib/simpleton.rb
radiantcms-couchrest_model-0.1.1 lib/simpleton.rb
radiantcms-couchrest_model-0.1 lib/simpleton.rb
radiant-0.7.2 lib/simpleton.rb
radiant-0.9.1 lib/simpleton.rb
radiant-0.8.2 lib/simpleton.rb
radiant-0.9.0.rc2 lib/simpleton.rb
radiant-rc-0.9.0 lib/simpleton.rb
radiant-0.8.1 lib/simpleton.rb
radiant-0.6.1 lib/simpleton.rb
radiant-0.6.0 lib/simpleton.rb