Sha256: 4ba3c76b366406b3daa12641b64f16e55cf537f48416b09413a0a103906c2f4e

Contents?: true

Size: 640 Bytes

Versions: 69

Compression:

Stored size: 640 Bytes

Contents

module CassandraObject
  module Configuration
    extend ActiveSupport::Concern
    
    module ClassMethods

      def recursive_symbolize_keys!(hash)
        hash.symbolize_keys!
        hash.values.select{|v| v.is_a? Hash}.each{|h| recursive_symbolize_keys!(h)}
      end

      @@config = nil
      def config=(config)
        raise('attempt to set config multiple times') if @@config

        recursive_symbolize_keys!(config)

        (@@config = config).tap do
          set_default_consistencies(@@config)
          establish_connection(@@config)
        end
      end
      def config
        @@config
      end

    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
sessionm-cassandra_object-4.0.32 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.31 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.30 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.29 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.28 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.27 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.26 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.25 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.24 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.23 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.22 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.21 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.20 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-2.7.5 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-2.7.4 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.18 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.17 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.16 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.15 lib/cassandra_object/configuration.rb
sessionm-cassandra_object-4.0.14 lib/cassandra_object/configuration.rb