Module: ActiveColumn::Configuration
- Included in:
- ActiveColumn
- Defined in:
- lib/active_column/configuration.rb
Instance Method Summary collapse
- #column_family_tasks ⇒ Object
- #connect(config) ⇒ Object
- #connected? ⇒ Boolean
- #connection ⇒ Object
- #connection=(connection) ⇒ Object
- #keyspace_tasks ⇒ Object
Instance Method Details
#column_family_tasks ⇒ Object
30 31 32 |
# File 'lib/active_column/configuration.rb', line 30 def column_family_tasks ActiveColumn::Tasks::ColumnFamily.new(@@keyspace) end |
#connect(config) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/active_column/configuration.rb', line 5 def connect(config) = { :timeout => 3, :retries => 2, :server_retry_period => nil } = (config['thrift'] || {}).inject({}){|h, (k, v)| h[k.to_sym] = v; h} # symbolize keys = .merge() self.connection = Cassandra.new(config['keyspace'], config['servers'], ) end |
#connected? ⇒ Boolean
12 13 14 |
# File 'lib/active_column/configuration.rb', line 12 def connected? defined? @@connection end |
#connection ⇒ Object
16 17 18 |
# File 'lib/active_column/configuration.rb', line 16 def connection @@connection end |
#connection=(connection) ⇒ Object
20 21 22 23 24 |
# File 'lib/active_column/configuration.rb', line 20 def connection=(connection) @@connection = connection @@keyspace_tasks = ActiveColumn::Tasks::Keyspace.new @@keyspace = connection.keyspace end |
#keyspace_tasks ⇒ Object
26 27 28 |
# File 'lib/active_column/configuration.rb', line 26 def keyspace_tasks @@keyspace_tasks end |