Class: CassandraURI
- Inherits:
-
Object
- Object
- CassandraURI
- Defined in:
- lib/sf_commons/cassandra_uri.rb
Instance Method Summary collapse
-
#initialize(uri) ⇒ CassandraURI
constructor
A new instance of CassandraURI.
- #keyspace ⇒ Object
- #pool_size ⇒ Object
- #server ⇒ Object
- #to_options ⇒ Object
Constructor Details
#initialize(uri) ⇒ CassandraURI
Returns a new instance of CassandraURI.
2 3 4 5 6 7 |
# File 'lib/sf_commons/cassandra_uri.rb', line 2 def initialize(uri) @uri = Addressable::URI.parse(uri) raise "Are you sure this is a cassandra server" if @uri.scheme != 'cassandra' = @uri.query_values || {} @poolsize = .delete("pool") || 25 end |
Instance Method Details
#keyspace ⇒ Object
9 10 11 |
# File 'lib/sf_commons/cassandra_uri.rb', line 9 def keyspace @uri.basename if @uri.basename end |
#pool_size ⇒ Object
12 13 14 |
# File 'lib/sf_commons/cassandra_uri.rb', line 12 def pool_size @poolsize.to_i end |
#server ⇒ Object
15 16 17 |
# File 'lib/sf_commons/cassandra_uri.rb', line 15 def server @uri. end |
#to_options ⇒ Object
19 20 21 |
# File 'lib/sf_commons/cassandra_uri.rb', line 19 def end |