Class: EventMachine::Protocols::Couchbase::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/em-couchbase/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Result

Returns a new instance of Result.



32
33
34
35
36
37
38
# File 'lib/em-couchbase/result.rb', line 32

def initialize(attributes = {})
  attributes.each do |k, v|
    if respond_to?(k)
      instance_variable_set("@#{k}", v)
    end
  end
end

Instance Attribute Details

#casObject

Returns the value of attribute cas.



24
25
26
# File 'lib/em-couchbase/result.rb', line 24

def cas
  @cas
end

#errorObject

Returns the value of attribute error.



25
26
27
# File 'lib/em-couchbase/result.rb', line 25

def error
  @error
end

#flagsObject

Returns the value of attribute flags.



26
27
28
# File 'lib/em-couchbase/result.rb', line 26

def flags
  @flags
end

#keyObject

Returns the value of attribute key.



27
28
29
# File 'lib/em-couchbase/result.rb', line 27

def key
  @key
end

#nodeObject

Returns the value of attribute node.



28
29
30
# File 'lib/em-couchbase/result.rb', line 28

def node
  @node
end

#operationObject

Returns the value of attribute operation.



29
30
31
# File 'lib/em-couchbase/result.rb', line 29

def operation
  @operation
end

#valueObject

Returns the value of attribute value.



30
31
32
# File 'lib/em-couchbase/result.rb', line 30

def value
  @value
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/em-couchbase/result.rb', line 40

def success?
  !@error
end