Class: CassandraBackup::Cqlsh
- Inherits:
-
Object
- Object
- CassandraBackup::Cqlsh
- Defined in:
- lib/cassandra_backup/cqlsh.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #exec(command) ⇒ Object
-
#initialize(config) ⇒ Cqlsh
constructor
A new instance of Cqlsh.
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
#config ⇒ Object (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 |