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.3.15 lib/flexirest/request_delegator.rb
flexirest-1.3.14 lib/flexirest/request_delegator.rb
flexirest-1.3.13 lib/flexirest/request_delegator.rb
flexirest-1.3.12 lib/flexirest/request_delegator.rb
flexirest-1.3.10 lib/flexirest/request_delegator.rb
flexirest-1.3.9 lib/flexirest/request_delegator.rb
flexirest-1.3.8 lib/flexirest/request_delegator.rb
flexirest-1.3.7 lib/flexirest/request_delegator.rb
flexirest-1.3.6 lib/flexirest/request_delegator.rb
flexirest-1.3.5 lib/flexirest/request_delegator.rb
flexirest-1.3.4 lib/flexirest/request_delegator.rb
flexirest-1.3.3 lib/flexirest/request_delegator.rb
flexirest-1.3.2 lib/flexirest/request_delegator.rb
flexirest-1.3.1 lib/flexirest/request_delegator.rb
flexirest-1.2.19 lib/flexirest/request_delegator.rb
flexirest-1.2.18 lib/flexirest/request_delegator.rb
flexirest-1.2.17 lib/flexirest/request_delegator.rb
flexirest-1.2.16 lib/flexirest/request_delegator.rb
flexirest-1.2.15 lib/flexirest/request_delegator.rb
flexirest-1.2.14 lib/flexirest/request_delegator.rb