Module: CheapAdvice::Options

Included in:
CheapAdvice, Advised
Defined in:
lib/cheap_advice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#optionsObject

Hash accesible by #[] and #[]=.



15
16
17
# File 'lib/cheap_advice.rb', line 15

def options
  @options
end

Instance Method Details

#[](k) ⇒ Object



21
22
23
24
25
# File 'lib/cheap_advice.rb', line 21

def [](k)
  # @mutex.synchronize do
    @options[k]
  # end
end

#[]=(k, v) ⇒ Object



27
28
29
30
31
# File 'lib/cheap_advice.rb', line 27

def []=(k, v)
  # @mutex.synchronize do
    @options[k] = v
  # end
end

#initializeObject



16
17
18
19
# File 'lib/cheap_advice.rb', line 16

def initialize
  @mutex = Mutex.new
  @options = { }
end