Class: ROM::Cassandra::Relation
- Inherits:
-
Relation
- Object
- Relation
- ROM::Cassandra::Relation
- Defined in:
- lib/rom/cassandra/relation.rb
Overview
Relation subclass of Cassandra adapter
Instance Attribute Summary collapse
-
#source ⇒ ROM::Cassandra::Dataset
readonly
The source dataset before `get` method has been applied.
Instance Method Summary collapse
-
#batch_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#delete` lazy query.
-
#delete_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#delete` lazy query.
-
#initialize ⇒ Relation
constructor
A new instance of Relation.
-
#insert_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#insert` lazy query.
-
#update_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#update` lazy query.
Constructor Details
#initialize ⇒ Relation
Returns a new instance of Relation.
33 34 35 36 37 38 |
# File 'lib/rom/cassandra/relation.rb', line 33 def initialize(*) super return if (@source = [:source]) @source = dataset @dataset = dataset.get end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
78 79 80 |
# File 'lib/rom/cassandra/relation.rb', line 78 def method_missing(name, *args) reload dataset.public_send(name, *args) end |
Instance Attribute Details
#source ⇒ ROM::Cassandra::Dataset (readonly)
Returns The source dataset before `get` method has been applied.
30 31 32 |
# File 'lib/rom/cassandra/relation.rb', line 30 def source @source end |
Instance Method Details
#batch_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#delete` lazy query
68 69 70 |
# File 'lib/rom/cassandra/relation.rb', line 68 def batch_query reload source.batch end |
#delete_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#delete` lazy query
60 61 62 |
# File 'lib/rom/cassandra/relation.rb', line 60 def delete_query reload source.delete end |
#insert_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#insert` lazy query
44 45 46 |
# File 'lib/rom/cassandra/relation.rb', line 44 def insert_query reload source.insert end |
#update_query ⇒ ROM::Cassandra::Relation
Returns the relation whose source is restricted by `#update` lazy query
52 53 54 |
# File 'lib/rom/cassandra/relation.rb', line 52 def update_query reload source.update end |