Class: Couchbase::LookupInSpec
- Inherits:
-
Object
- Object
- Couchbase::LookupInSpec
- Defined in:
- lib/couchbase/subdoc.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.count(path) ⇒ LookupInSpec
Counts the number of values at a given path in the document.
-
.exists(path) ⇒ LookupInSpec
Checks if a value at the given path exists in the document.
-
.get(path) ⇒ LookupInSpec
Fetches the content from a field (if present) at the given path.
Instance Method Summary collapse
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
61 62 63 |
# File 'lib/couchbase/subdoc.rb', line 61 def path @path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
60 61 62 |
# File 'lib/couchbase/subdoc.rb', line 60 def type @type end |
Class Method Details
.count(path) ⇒ LookupInSpec
Counts the number of values at a given path in the document
47 48 49 |
# File 'lib/couchbase/subdoc.rb', line 47 def self.count(path) new(:count, path) end |
.exists(path) ⇒ LookupInSpec
Checks if a value at the given path exists in the document
39 40 41 |
# File 'lib/couchbase/subdoc.rb', line 39 def self.exists(path) new(:exists, path) end |
.get(path) ⇒ LookupInSpec
Fetches the content from a field (if present) at the given path
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/couchbase/subdoc.rb', line 24 def self.get(path) case path when Symbol new(:get, (path)) when "" new(:get_doc, "") else new(:get, path) end end |
Instance Method Details
#xattr ⇒ Object
51 52 53 54 |
# File 'lib/couchbase/subdoc.rb', line 51 def xattr @xattr = true self end |
#xattr? ⇒ Boolean
56 57 58 |
# File 'lib/couchbase/subdoc.rb', line 56 def xattr? @xattr end |