Class: RFuse::Flock

Inherits:
Object
  • Object
show all
Defined in:
lib/rfuse/flock.rb

Overview

Wrapper for FFI:Flock back to RFuse

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ffi_flock) ⇒ Flock

Returns a new instance of Flock.



7
8
9
# File 'lib/rfuse/flock.rb', line 7

def initialize(ffi_flock)
  @delegate = ffi_flock
end

Instance Attribute Details

#delegateObject (readonly)

Returns the value of attribute delegate.



5
6
7
# File 'lib/rfuse/flock.rb', line 5

def delegate
  @delegate
end

Instance Method Details

#l_lenObject



23
24
25
# File 'lib/rfuse/flock.rb', line 23

def l_len
  delegate.len
end

#l_pidObject



27
28
29
# File 'lib/rfuse/flock.rb', line 27

def l_pid
  delegate.pid
end

#l_startObject



19
20
21
# File 'lib/rfuse/flock.rb', line 19

def l_start
  delegate.start
end

#l_typeObject



11
12
13
# File 'lib/rfuse/flock.rb', line 11

def l_type
  FFI::Flock::Enums::LockType.to_h[delegate.type] || 0
end

#l_whenceObject



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

def l_whence
  FFI::Flock::Enums::SeekWhenceShort.to_h[delegate.whence] || 0
end