Class: ShyCouch::Data::ViewResult

Inherits:
Hash
  • Object
show all
Defined in:
lib/ShyCouch/data.rb

Defined Under Namespace

Classes: ViewResultRow

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(res) ⇒ ViewResult

Returns a new instance of ViewResult.



341
342
343
344
345
346
347
348
# File 'lib/ShyCouch/data.rb', line 341

def initialize res
@total_rows = res["total_rows"]
@offset = res["offset"]

res["rows"].each do |row|
	merge! row["key"] => ViewResultRow.new(row["value"], row["key"])
end
end

Instance Attribute Details

#offsetObject

This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead



340
341
342
# File 'lib/ShyCouch/data.rb', line 340

def offset
  @offset
end

#total_rowsObject

This is the result of a view query If the view was called with ?include_docs=true, initializing this object returns a DocumentCollection instead



340
341
342
# File 'lib/ShyCouch/data.rb', line 340

def total_rows
  @total_rows
end