Class: Quandl::Cassandra::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/quandl/cassandra/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



21
22
23
24
25
26
27
# File 'lib/quandl/cassandra/configuration.rb', line 21

def initialize
  @hosts = ['localhost']
  @consistency = :all
  @read_consistency = :one
  @write_consistency = :one
  @batch_size = 35 * 4
end

Instance Attribute Details

#batch_sizeObject

Returns the value of attribute batch_size.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def batch_size
  @batch_size
end

#consistencyObject

Returns the value of attribute consistency.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def consistency
  @consistency
end

#hostsObject

Returns the value of attribute hosts.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def hosts
  @hosts
end

#keyspaceObject

Returns the value of attribute keyspace.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def keyspace
  @keyspace
end

#read_consistencyObject

Returns the value of attribute read_consistency.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def read_consistency
  @read_consistency
end

#write_consistencyObject

Returns the value of attribute write_consistency.



19
20
21
# File 'lib/quandl/cassandra/configuration.rb', line 19

def write_consistency
  @write_consistency
end

Instance Method Details

#attributesObject



29
30
31
# File 'lib/quandl/cassandra/configuration.rb', line 29

def attributes
  { hosts: hosts, consistency: consistency, keyspace: keyspace, batch_size: batch_size }
end

#to_hObject



33
34
35
# File 'lib/quandl/cassandra/configuration.rb', line 33

def to_h
  attributes
end