Class: Garcon::Secret::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/garcon/secret.rb

Overview

A Configuration instance

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Yields:

  • (_self)

Yield Parameters:



69
70
71
72
73
74
75
76
# File 'lib/garcon/secret.rb', line 69

def initialize(options = {})
  @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.

Returns:

  • (String)

    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.

Returns:

  • (String)

    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.

Returns:

  • (String)

    The shared Stash (in-memory cache) for this instance.



58
# File 'lib/garcon/secret.rb', line 58

attr_accessor :stash

#lockObject (readonly)

Returns the value of attribute lock.



54
55
56
# File 'lib/garcon/secret.rb', line 54

def lock
  @lock
end

#queueObject

Returns the value of attribute queue.



62
63
64
# File 'lib/garcon/secret.rb', line 62

def queue
  @queue
end

#stashObject

Returns the value of attribute stash.



58
59
60
# File 'lib/garcon/secret.rb', line 58

def stash
  @stash
end

Instance Method Details

#to_hObject

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