Sha256: b0adbb45949bcac56d8ab4730216835a94ea1d19cc5532e04eb4ebbb599ffaa1

Contents?: true

Size: 528 Bytes

Versions: 18

Compression:

Stored size: 528 Bytes

Contents

module CDQ
  class CDQObjectProxy < CDQObject

    def initialize(object)
      @object = object
    end

    def get
      @object
    end

    def respond_to?(method)
      super(method) || @object.entity.relationshipsByName[method]
    end

    def method_missing(*args)
      if @object.entity.relationshipsByName[args.first]
        CDQRelationshipQuery.new(@object, args.first)
      else
        super(*args)
      end
    end

    def destroy
      @object.managedObjectContext.deleteObject(@object)
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
cdq-2.0.0 motion/cdq/object_proxy.rb
cdq-1.0.8 motion/cdq/object_proxy.rb
cdq-1.0.7 motion/cdq/object_proxy.rb
cdq-1.0.6 motion/cdq/object_proxy.rb
cdq-1.0.4 motion/cdq/object_proxy.rb
cdq-1.0.3 motion/cdq/object_proxy.rb
cdq-1.0.2 motion/cdq/object_proxy.rb
cdq-1.0.1 motion/cdq/object_proxy.rb
cdq-1.0.0 motion/cdq/object_proxy.rb
cdq-0.1.11 motion/cdq/object_proxy.rb
cdq-0.1.10 motion/cdq/object_proxy.rb
cdq-0.1.9 motion/cdq/object_proxy.rb
cdq-0.1.8 motion/cdq/object_proxy.rb
cdq-0.1.7 motion/cdq/object_proxy.rb
cdq-0.1.6 motion/cdq/object_proxy.rb
cdq-0.1.5 motion/cdq/object_proxy.rb
cdq-0.1.2 motion/cdq/object_proxy.rb
cdq-0.1.1 motion/cdq/object_proxy.rb