Class: ROM::RethinkDB::Dataset
- Inherits:
-
Object
- Object
- ROM::RethinkDB::Dataset
- Defined in:
- lib/rom/rethinkdb/dataset.rb
Overview
Dataset for RethinkDB
Instance Attribute Summary collapse
- #connection ⇒ Object readonly
- #rql ⇒ Object readonly
- #scope ⇒ Object readonly
Instance Method Summary collapse
- #count ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(scope, rql, connection) ⇒ Dataset
constructor
A new instance of Dataset.
- #to_a ⇒ Object
Constructor Details
#initialize(scope, rql, connection) ⇒ Dataset
Returns a new instance of Dataset.
9 10 11 12 13 |
# File 'lib/rom/rethinkdb/dataset.rb', line 9 def initialize(scope, rql, connection) @scope = scope @rql = rql @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
7 8 9 |
# File 'lib/rom/rethinkdb/dataset.rb', line 7 def connection @connection end |
#rql ⇒ Object (readonly)
7 8 9 |
# File 'lib/rom/rethinkdb/dataset.rb', line 7 def rql @rql end |
#scope ⇒ Object (readonly)
7 8 9 |
# File 'lib/rom/rethinkdb/dataset.rb', line 7 def scope @scope end |
Instance Method Details
#count ⇒ Object
23 24 25 |
# File 'lib/rom/rethinkdb/dataset.rb', line 23 def count scope.count.run(connection) end |
#each(&block) ⇒ Object
19 20 21 |
# File 'lib/rom/rethinkdb/dataset.rb', line 19 def each(&block) to_a.each(&block) end |
#to_a ⇒ Object
15 16 17 |
# File 'lib/rom/rethinkdb/dataset.rb', line 15 def to_a scope.run(connection) end |