Class: CassSchema::Cluster

Inherits:
Struct
  • Object
show all
Defined in:
lib/cass_schema/cluster.rb

Overview

A struct representing a Cassandra cluster.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#connectionObject

Returns the value of attribute connection

Returns:

  • (Object)

    the current value of connection



6
7
8
# File 'lib/cass_schema/cluster.rb', line 6

def connection
  @connection
end

Class Method Details

.build(hash) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'lib/cass_schema/cluster.rb', line 7

def self.build(hash)
  l = hash.with_indifferent_access

  if l[:hosts]
    l[:connection] ||= Cassandra.cluster(hosts: l[:hosts], port: l[:port])
  end

  new(l[:connection])
end