Sha256: ddf2e19cd30b9ab409955164ca06a732f737af65bc23ad4ed61df0fc70e55281
Contents?: true
Size: 871 Bytes
Versions: 119
Compression:
Stored size: 871 Bytes
Contents
module CassandraObject module Consistency extend ActiveSupport::Concern included do cattr_accessor :consistency_levels self.consistency_levels = [:one, :quorum, :all] class_attribute :write_consistency class_attribute :read_consistency self.write_consistency = :quorum self.read_consistency = :quorum end module ClassMethods THRIFT_LEVELS = { :one => Cassandra::Consistency::ONE, :quorum => Cassandra::Consistency::QUORUM, :all => Cassandra::Consistency::ALL } def thrift_read_consistency THRIFT_LEVELS[read_consistency] || (raise "Invalid consistency level #{read_consistency}") end def thrift_write_consistency THRIFT_LEVELS[write_consistency] || (raise "Invalid consistency level #{write_consistency}") end end end end
Version data entries
119 entries across 119 versions & 2 rubygems