Class: Couchbase::Collection::ExistsResult

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/collection_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|| ... } ⇒ ExistsResult

Returns a new instance of ExistsResult.

Yield Parameters:



106
107
108
# File 'lib/couchbase/collection_options.rb', line 106

def initialize
  yield self if block_given?
end

Instance Attribute Details

#casInteger

Returns holds the CAS value of the fetched document.

Returns:

  • (Integer)

    holds the CAS value of the fetched document



96
97
98
# File 'lib/couchbase/collection_options.rb', line 96

def cas
  @cas
end

#deletedBoolean

Returns true if the document was deleted.

Returns:

  • (Boolean)

    true if the document was deleted



99
100
101
# File 'lib/couchbase/collection_options.rb', line 99

def deleted
  @deleted
end

#existsBoolean Also known as: exists?

Returns true if the document exists.

Returns:

  • (Boolean)

    true if the document exists



102
103
104
# File 'lib/couchbase/collection_options.rb', line 102

def exists
  @exists
end

#expiry=(value) ⇒ Integer (writeonly)

Returns the expiration if fetched and present.

Returns:

  • (Integer)

    the expiration if fetched and present



111
112
113
# File 'lib/couchbase/collection_options.rb', line 111

def expiry=(value)
  @expiry = value
end

Instance Method Details

#expiry_timeTime

Returns time when the document will expire.

Returns:

  • (Time)

    time when the document will expire



114
115
116
# File 'lib/couchbase/collection_options.rb', line 114

def expiry_time
  Time.at(@expiry) if @expiry
end