Sha256: b58e40274d140ca6f85819a9de12fbb5ef3bb9578b79e898c6d79bebf5eaa22b

Contents?: true

Size: 794 Bytes

Versions: 134

Compression:

Stored size: 794 Bytes

Contents

module Flexirest
  class RequestDelegator < Delegator
    def initialize(obj)
      super
      @delegate_obj = obj
    end

    def __getobj__
      @delegate_obj
    end

    def __setobj__(obj)
      @delegate_obj = obj
    end

    def class
      @delegate_obj.class
    end

    def method_missing(name, *args, &block)
      # Handles issue with private method 'test' on base Ruby Object
      return @delegate_obj.test if name.to_sym == :test

      # Forward request to delegate
      @delegate_obj.send(name, *args, &block)
    end

    def kind_of?(obj)
      @delegate_obj.kind_of?(obj)
    end

    def is_a?(obj)
      @delegate_obj.is_a?(obj)
    end

    def instance_of?(obj)
      @delegate_obj.instance_of?(obj)
    end

    def _delegate?
      return true
    end
  end
end

Version data entries

134 entries across 134 versions & 1 rubygems

Version Path
flexirest-1.12.4 lib/flexirest/request_delegator.rb
flexirest-1.12.3 lib/flexirest/request_delegator.rb
flexirest-1.12.2 lib/flexirest/request_delegator.rb
flexirest-1.12.1 lib/flexirest/request_delegator.rb
flexirest-1.12.0 lib/flexirest/request_delegator.rb
flexirest-1.11.3 lib/flexirest/request_delegator.rb
flexirest-1.11.2 lib/flexirest/request_delegator.rb
flexirest-1.11.1 lib/flexirest/request_delegator.rb
flexirest-1.11.0 lib/flexirest/request_delegator.rb
flexirest-1.10.12 lib/flexirest/request_delegator.rb
flexirest-1.10.11 lib/flexirest/request_delegator.rb
flexirest-1.10.10 lib/flexirest/request_delegator.rb
flexirest-1.10.9 lib/flexirest/request_delegator.rb
flexirest-1.10.8 lib/flexirest/request_delegator.rb
flexirest-1.10.7 lib/flexirest/request_delegator.rb
flexirest-1.10.6 lib/flexirest/request_delegator.rb
flexirest-1.10.5 lib/flexirest/request_delegator.rb
flexirest-1.10.4 lib/flexirest/request_delegator.rb
flexirest-1.10.3 lib/flexirest/request_delegator.rb
flexirest-1.10.2 lib/flexirest/request_delegator.rb