Class: SolidCacheMongoid::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/solid_cache_mongoid/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store_options: {}, database: nil, collection: nil, client: nil, executor: nil, encrypt: false, encryption_context_properties: nil, size_estimate_samples: 10_000) ⇒ Configuration

Returns a new instance of Configuration.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/solid_cache_mongoid/configuration.rb', line 7

def initialize(
  store_options: {}, database: nil, collection: nil, client: nil,
  executor: nil, encrypt: false, encryption_context_properties: nil, size_estimate_samples: 10_000
)
  @store_options = store_options
  @size_estimate_samples = size_estimate_samples
  @executor = executor
  @encrypt = encrypt
  @client = client
  @collection = collection || "solid_cache_entries"
  @database = database || "solid_cache_mongoid"
  @encryption_context_properties = encryption_context_properties
  @encryption_context_properties ||= default_encryption_context_properties if encrypt?
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def client
  @client
end

#collectionObject (readonly)

Returns the value of attribute collection.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def collection
  @collection
end

#databaseObject (readonly)

Returns the value of attribute database.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def database
  @database
end

#encryptObject (readonly)

Returns the value of attribute encrypt.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def encrypt
  @encrypt
end

#encryption_context_propertiesObject (readonly)

Returns the value of attribute encryption_context_properties.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def encryption_context_properties
  @encryption_context_properties
end

#executorObject (readonly)

Returns the value of attribute executor.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def executor
  @executor
end

#size_estimate_samplesObject (readonly)

Returns the value of attribute size_estimate_samples.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def size_estimate_samples
  @size_estimate_samples
end

#store_optionsObject (readonly)

Returns the value of attribute store_options.



5
6
7
# File 'lib/solid_cache_mongoid/configuration.rb', line 5

def store_options
  @store_options
end

Instance Method Details

#encrypt?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/solid_cache_mongoid/configuration.rb', line 22

def encrypt?
  encrypt.present?
end