Module: Cassie::Connection

Extended by:
ClassMethods
Included in:
Definition, Modification, Query
Defined in:
lib/cassie/connection.rb

Overview

Defines interface providing Cassandra connection management including object cacheing and reuse behavior in line with Cassandra best practices

include Cassie::Connection to add keyspace and session attributes to the including module.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.keyspace(val = NilClass) ⇒ Object Originally defined in module ClassMethods

.keyspace=(val) ⇒ Object Originally defined in module ClassMethods

Instance Method Details

#keyspaceObject


44
45
46
47
# File 'lib/cassie/connection.rb', line 44

def keyspace
  return @keyspace if defined?(@keyspace)
  self.class.keyspace
end

#sessionObject


49
50
51
# File 'lib/cassie/connection.rb', line 49

def session
  Cassie.session(keyspace)
end