Class: Garcon::Secret::Configuration
Overview
A Configuration instance
Instance Attribute Summary collapse
-
#:lock(: lock) ⇒ String
readonly
Access the shared Monitor for this instance.
-
#:queue(: queue) ⇒ String
The shared queue object for this instance.
-
#:stash(: stash) ⇒ String
The shared Stash (in-memory cache) for this instance.
-
#lock ⇒ Object
readonly
Returns the value of attribute lock.
-
#queue ⇒ Object
Returns the value of attribute queue.
-
#stash ⇒ Object
Returns the value of attribute stash.
Instance Method Summary collapse
-
#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
69 70 71 72 73 74 75 76 |
# File 'lib/garcon/secret.rb', line 69 def initialize( = {}) @lock = Monitor.new @stash = MemStash.new @queue = MutexPriorityQueue.new @queue << Secret.tmpfile until @queue.length >= 4 yield self if block_given? end |
Instance Attribute Details
#:lock(: lock) ⇒ String (readonly)
Returns Access the shared Monitor for this instance.
54 |
# File 'lib/garcon/secret.rb', line 54 attr_reader :lock |
#:queue(: queue) ⇒ String
Returns The shared queue object for this instance.
62 |
# File 'lib/garcon/secret.rb', line 62 attr_accessor :queue |
#:stash(: stash) ⇒ String
Returns The shared Stash (in-memory cache) for this instance.
58 |
# File 'lib/garcon/secret.rb', line 58 attr_accessor :stash |
#lock ⇒ Object (readonly)
Returns the value of attribute lock.
54 55 56 |
# File 'lib/garcon/secret.rb', line 54 def lock @lock end |
#queue ⇒ Object
Returns the value of attribute queue.
62 63 64 |
# File 'lib/garcon/secret.rb', line 62 def queue @queue end |
#stash ⇒ Object
Returns the value of attribute stash.
58 59 60 |
# File 'lib/garcon/secret.rb', line 58 def stash @stash end |
Instance Method Details
#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.
79 80 81 82 83 84 |
# File 'lib/garcon/secret.rb', line 79 def to_h { lock: lock, stash: stash, queue: queue }.freeze end |