Class: CouchDB::Row
- Inherits:
-
Object
- Object
- CouchDB::Row
- Defined in:
- lib/couchdb/row.rb
Overview
The Row class acts as a wrapper for a CouchDB view result row.
Instance Attribute Summary collapse
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #document ⇒ Object
-
#initialize(database, attributes = { }) ⇒ Row
constructor
A new instance of Row.
Constructor Details
#initialize(database, attributes = { }) ⇒ Row
Returns a new instance of Row.
12 13 14 |
# File 'lib/couchdb/row.rb', line 12 def initialize(database, attributes = { }) @database, @id, @key, @value, @document = database, *attributes.values_at("id", "key", "value", "doc") end |
Instance Attribute Details
#database ⇒ Object (readonly)
Returns the value of attribute database.
7 8 9 |
# File 'lib/couchdb/row.rb', line 7 def database @database end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/couchdb/row.rb', line 8 def id @id end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/couchdb/row.rb', line 9 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
10 11 12 |
# File 'lib/couchdb/row.rb', line 10 def value @value end |