Class: Couchbase::Cluster::QueryResult
- Inherits:
-
Object
- Object
- Couchbase::Cluster::QueryResult
- Defined in:
- lib/couchbase/query_options.rb,
/code/couchbase-ruby-client/lib/couchbase/query_options.rb
Instance Attribute Summary collapse
-
#meta_data ⇒ QueryMetaData
Returns object representing additional metadata associated with this query.
-
#transcoder ⇒ Object
Returns the value of attribute transcoder.
Instance Method Summary collapse
-
#initialize {|self| ... } ⇒ QueryResult
constructor
A new instance of QueryResult.
-
#rows(transcoder = self.transcoder) ⇒ Array
Returns all rows converted using a transcoder.
Constructor Details
#initialize {|self| ... } ⇒ QueryResult
Returns a new instance of QueryResult.
41 42 43 44 |
# File 'lib/couchbase/query_options.rb', line 41 def initialize yield self if block_given? @transcoder = :json end |
Instance Attribute Details
#meta_data ⇒ QueryMetaData
Returns object representing additional metadata associated with this query
23 24 25 |
# File 'lib/couchbase/query_options.rb', line 23 def @meta_data end |
#transcoder ⇒ Object
Returns the value of attribute transcoder.
25 26 27 |
# File 'lib/couchbase/query_options.rb', line 25 def transcoder @transcoder end |
Instance Method Details
#rows(transcoder = self.transcoder) ⇒ Array
Returns all rows converted using a transcoder
30 31 32 33 34 35 36 37 38 |
# File 'lib/couchbase/query_options.rb', line 30 def rows(transcoder = self.transcoder) @rows.lazy.map do |row| if transcoder == :json JSON.parse(row) else transcoder.call(row) end end end |