Sha256: 83d8919afdf88fe9d0c6705ee5cb4e8f3b6256099d31948f6d576def183088ff

Contents?: true

Size: 469 Bytes

Versions: 9

Compression:

Stored size: 469 Bytes

Contents

module Fancygrid
  class ObjectWrapper      
    
    # Initializes the object wrapper
    #
    def initialize obj
      @wrapped = obj
    end
    
    # Gets the wrapped object
    #
    def object
      @wrapped
    end
    
    # Sends the missing method to the wrapped object
    # and stores the result as the new wrapped object
    #
    def method_missing(method, *args, &block)
      @wrapped = @wrapped.send(method, *args)
      return self
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
fancygrid-2.0.8 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.7 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.6 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.5 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.4 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.3 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.2 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.1 lib/fancygrid/object_wrapper.rb
fancygrid-2.0.0 lib/fancygrid/object_wrapper.rb