Class: AdmitOne::LockFile

Inherits:
Object
  • Object
show all
Defined in:
lib/admit_one/lock_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ LockFile

Returns a new instance of LockFile.



8
9
10
11
12
13
14
15
16
17
# File 'lib/admit_one/lock_file.rb', line 8

def initialize(name,&block)
  @name = name
  if lock! then
    begin
      yield
    ensure
      unlock!
    end
  end
end

Instance Attribute Details

#lock_fileObject

Returns the value of attribute lock_file.



6
7
8
# File 'lib/admit_one/lock_file.rb', line 6

def lock_file
  @lock_file
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/admit_one/lock_file.rb', line 6

def name
  @name
end