Class: Couchbase::Cluster::QueryResult
- Inherits:
-
Object
- Object
- Couchbase::Cluster::QueryResult
- Defined in:
- lib/couchbase/query_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/query_options.rb more...
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.
39 40 41 42 |
# File 'lib/couchbase/query_options.rb', line 39 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
21 22 23 |
# File 'lib/couchbase/query_options.rb', line 21 def @meta_data end |
#transcoder ⇒ Object
Returns the value of attribute transcoder.
23 24 25 |
# File 'lib/couchbase/query_options.rb', line 23 def transcoder @transcoder end |
Instance Method Details
#rows(transcoder = self.transcoder) ⇒ Array
Returns all rows converted using a transcoder
28 29 30 31 32 33 34 35 36 |
# File 'lib/couchbase/query_options.rb', line 28 def rows(transcoder = self.transcoder) @rows.lazy.map do |row| if transcoder == :json JSON.parse(row) else transcoder.call(row) end end end |