class LockManager
Attributes
options[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/lock_manager.rb, line 8 def initialize(options = {}) @options = options end
Public Instance Methods
connection()
click to toggle source
# File lib/lock_manager.rb, line 32 def connection raise ArgumentError, ':type option is required' unless options[:type] @connection ||= LockManager::Connection.connection_class(options[:type]).new(options) end
lock(host, user, reason = nil)
click to toggle source
# File lib/lock_manager.rb, line 12 def lock(host, user, reason = nil) LockManager::Worker.new(connection, host).lock(user, reason) end
locked?(host)
click to toggle source
# File lib/lock_manager.rb, line 24 def locked?(host) LockManager::Worker.new(connection, host).locked? end
polling_lock(host, user, reason = nil)
click to toggle source
# File lib/lock_manager.rb, line 16 def polling_lock(host, user, reason = nil) LockManager::Worker.new(connection, host).polling_lock(user, reason) end
show(host)
click to toggle source
# File lib/lock_manager.rb, line 28 def show(host) LockManager::Worker.new(connection, host).show end
unlock(host, user)
click to toggle source
# File lib/lock_manager.rb, line 20 def unlock(host, user) LockManager::Worker.new(connection, host).unlock(user) end