Class: Rack::Lock::Proxy

Inherits:
Struct
  • Object
show all
Defined in:
lib/rack/lock.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mutexObject

Returns the value of attribute mutex

Returns:

  • (Object)

    the current value of mutex



5
6
7
# File 'lib/rack/lock.rb', line 5

def mutex
  @mutex
end

#targetObject

Returns the value of attribute target

Returns:

  • (Object)

    the current value of target



5
6
7
# File 'lib/rack/lock.rb', line 5

def target
  @target
end

Instance Method Details

#closeObject



10
11
12
13
14
# File 'lib/rack/lock.rb', line 10

def close
  target.close if target.respond_to?(:close)
ensure
  mutex.unlock
end

#eachObject



6
7
8
# File 'lib/rack/lock.rb', line 6

def each
  target.each { |x| yield x }
end

#respond_to?(sym) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/rack/lock.rb', line 20

def respond_to?(sym)
  sym.to_sym == :close || target.respond_to?(sym)
end

#to_pathObject



16
17
18
# File 'lib/rack/lock.rb', line 16

def to_path
  target.to_path
end