Class: ActiveRecord::Base

### Home Classes Methods

### In Files

- lib/active_record/connection_adapters/cassandra_adapter.rb

### Parent

Object

### Methods

- ::cassandra_connection

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- ActiveRecord
- ActiveRecord::Base
- ActiveRecord::ConnectionAdapters
- ActiveRecord::ConnectionAdapters::CassandraAdapter
- ActiveCassandra
- ActiveCassandra::CF
- ActiveCassandra::SQLParser

No matching classes.

# ActiveRecord::Base

### Public Class Methods

cassandra_connection(config) click to toggle source

    # File lib/active_record/connection_adapters/cassandra_adapter.rb, line 9
    def self.cassandra_connection(config)
      config.symbolize_keys!
      host = config[:host] || '127.0.0.1'
      port = config[:port] || 9160

      unless (keyspace = config[:keyspace] || config[:database])
        raise ArgumentError, "No database file specified. Missing argument: keyspace"
      end

      thrift_client_options = config.dup
      [:adapter, :host, :port, :keyspace, :database].each {|i| thrift_client_options.delete(i) }

      client = Cassandra.new(keyspace, "#{host}:#{port}", thrift_client_options)
      ConnectionAdapters::CassandraAdapter.new(client, logger, config)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.