Sha256: 007cd30484f6d88f88260f375f2a5cee26ad6d1a28b219ba45d3e9112342b8d3

Contents?: true

Size: 591 Bytes

Versions: 1

Compression:

Stored size: 591 Bytes

Contents

module Couchbase
  class Result

    attr_accessor :error

    def initialize(attrs = {})
      @bucket    = attrs[:bucket]
      @key       = attrs[:key]
      @operation = attrs[:op]
      @future    = attrs[:future]
    end

    def operation
      @operation
    end

    def success?
      @future.get
    end

    def error
      @error
    end

    def key
      @key || @future.getKey
    end

    def value
      @future.get
    rescue MultiJson::LoadError
      nil
    end

    def cas
      @future.getCas if @future.respond_to?(:getCas)
    end

    def node

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couchbase-jruby-client-0.1.1 lib/couchbase/result.rb