Class: Hoodie::Configuration
Overview
A Configuration instance
Instance Attribute Summary collapse
-
#level ⇒ Symbol
Set the desired loging level.
-
#logging ⇒ Boolean
Enable or disable logging.
-
#store ⇒ Symbol
The current Stash Store.
Instance Method Summary collapse
-
#crypto(&block) ⇒ Crypto
private
Access the crypto for this instance and optional configure a new crypto with the passed block.
-
#initialize(options = {}) {|_self| ... } ⇒ undefined
constructor
private
Initialized a configuration instance.
- #to_h ⇒ Object private
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialized a configuration instance
42 43 44 45 46 47 48 49 |
# File 'lib/hoodie/configuration.rb', line 42 def initialize(={}) @logging = .fetch(:logging, false) @level = .fetch(:level, :info) @store = .fetch(:store, :memstore) @crypto = Crypto::Configuration.new yield self if block_given? end |
Instance Attribute Details
#level ⇒ Symbol
Returns Set the desired loging level.
31 32 33 |
# File 'lib/hoodie/configuration.rb', line 31 def level @level end |
#logging ⇒ Boolean
Returns Enable or disable logging.
27 28 29 |
# File 'lib/hoodie/configuration.rb', line 27 def logging @logging end |
#store ⇒ Symbol
Returns The current Stash Store.
35 36 37 |
# File 'lib/hoodie/configuration.rb', line 35 def store @store end |
Instance Method Details
#crypto(&block) ⇒ Crypto
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Access the crypto for this instance and optional configure a new crypto with the passed block.
63 64 65 66 |
# File 'lib/hoodie/configuration.rb', line 63 def crypto(&block) @crypto = Crypto::Configuration.new(&block) if block_given? @crypto end |
#to_h ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 72 73 74 |
# File 'lib/hoodie/configuration.rb', line 69 def to_h { logging: logging, level: level, store: store }.freeze end |