Class: CassandraBackup::Cqlsh

Inherits:
Object
  • Object
show all
Defined in:
lib/cassandra_backup/cqlsh.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Cqlsh

Returns a new instance of Cqlsh.



6
7
8
# File 'lib/cassandra_backup/cqlsh.rb', line 6

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/cassandra_backup/cqlsh.rb', line 4

def config
  @config
end

Instance Method Details

#exec(command) ⇒ Object



10
11
12
# File 'lib/cassandra_backup/cqlsh.rb', line 10

def exec(command)
  `echo "#{command};" | #{cqlsh} -k #{keyspace} #{server}`.sub(/^(.*)$/, '').strip
end