Class: CassandraBackup::Config
- Inherits:
-
Object
- Object
- CassandraBackup::Config
- Defined in:
- lib/cassandra_backup/config.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ input: STDIN, output: STDOUT, data: true, create_info: true, servers: ['127.0.0.1:9160'] }
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #connection ⇒ Object
-
#initialize(options = {}) ⇒ Config
constructor
A new instance of Config.
- #require_version! ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Config
Returns a new instance of Config.
12 13 14 15 |
# File 'lib/cassandra_backup/config.rb', line 12 def initialize( = {}) = DEFAULT_OPTIONS.dup.update() require_version! end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/cassandra_backup/config.rb', line 11 def end |
Instance Method Details
#connection ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/cassandra_backup/config.rb', line 29 def connection if keyspace = {keyspace: keyspace} else = {} end @connection ||= CassandraCQL::Database.new(servers, ) end |
#require_version! ⇒ Object
23 24 25 26 27 |
# File 'lib/cassandra_backup/config.rb', line 23 def require_version! if [:version] require "cassandra-cql/#{options[:version]}" end end |