Sha256: e38cc2bd0cfc8be3f2e995f1ade2d166e1a9b4a6835a696d522b402af8d71fb4

Contents?: true

Size: 467 Bytes

Versions: 116

Compression:

Stored size: 467 Bytes

Contents

module CassandraObject
  module Connection
    extend ActiveSupport::Concern
    
    included do
      class_attribute :connection
    end

    module ClassMethods
      DEFAULT_OPTIONS = {
        servers: "127.0.0.1:9160",
        thrift: {}
      }
      def establish_connection(spec)
        spec.reverse_merge!(DEFAULT_OPTIONS)
        self.connection = Cassandra.new(spec[:keyspace], spec[:servers], spec[:thrift].symbolize_keys!)
      end
    end
  end
end

Version data entries

116 entries across 116 versions & 2 rubygems

Version Path
gotime-cassandra_object-2.11.9 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.8 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.7 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.6 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.5 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.4 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.48 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.3 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.47 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.46 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.45 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.44 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.2 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.43 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.42 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.41 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.1 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.40 lib/cassandra_object/connection.rb
gotime-cassandra_object-2.11.0 lib/cassandra_object/connection.rb
sessionm-cassandra_object-2.2.39 lib/cassandra_object/connection.rb