Method: Couchbase::ViewRow#initialize
- Defined in:
- lib/couchbase/view_row.rb
#initialize(bucket, data) ⇒ ViewRow
Initialize the document instance
It takes reference to the bucket, data hash.
96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/couchbase/view_row.rb', line 96 def initialize(bucket, data) @bucket = bucket @data = data @key = data[S_KEY] @value = data[S_VALUE] if data[S_DOC] @meta = data[S_DOC][S_META] @doc = data[S_DOC][S_VALUE] end @id = data[S_ID] || @meta && @meta[S_ID] @last = data.delete(S_IS_LAST) || false end |