Class: Mount::Update

Inherits:
Object
  • Object
show all
Defined in:
lib/rbmount/update.rb

Instance Method Summary collapse

Constructor Details

#initializeUpdate

Returns a new instance of Update.



25
26
27
28
29
30
# File 'lib/rbmount/update.rb', line 25

def initialize
  @pointer = Mount::C.mnt_new_update
  raise unless @pointer

  ObjectSpace.define_finalizer(self, method(:finalize))
end

Instance Method Details

#filenameObject



36
37
38
# File 'lib/rbmount/update.rb', line 36

def filename
  Mount::C.mnt_update_get_filename(@pointer)
end

#finalizeObject



65
66
67
# File 'lib/rbmount/update.rb', line 65

def finalize
  Mount::C.mnt_free_update(@pointer)
end

#fsObject



40
41
42
43
44
45
46
47
# File 'lib/rbmount/update.rb', line 40

def fs
  Mount::C.mnt_update_get_fs(@pointer).tap {|fsp|
    break Mount::FS.allocate.tap {|f| f.instance_eval {
      @pointer = fsp
      ObjectSpace.define_finalizer(self, method(:finalize))
    }}
  }
end

#fs=(mountflags, target, fsp = nil) ⇒ Object



57
58
59
# File 'lib/rbmount/update.rb', line 57

def fs= (mountflags, target, fsp=nil)
  Mount::C.mnt_update_set_fs(@pointer, mountflags, target, (fsp ? fsp.to_c : fsp))
end

#mflagsObject



49
50
51
# File 'lib/rbmount/update.rb', line 49

def mflags
  Mount::C.mnt_update_get_mflags(@pointer)
end

#read_only=(is_read_only) ⇒ Object



32
33
34
# File 'lib/rbmount/update.rb', line 32

def read_only= (is_read_only)
  Mount::C.mnt_update_force_rdonly(@pointer, !!is_read_only)
end

#ready?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/rbmount/update.rb', line 53

def ready?
  Mount::C.mnt_update_is_ready(@pointer)
end

#table(lc = nil) ⇒ Object



61
62
63
# File 'lib/rbmount/update.rb', line 61

def table (lc=nil)
  Mount::C.mnt_update_table(@pointer, (lc ? lc.to_c : lc))
end

#to_cObject



69
70
71
# File 'lib/rbmount/update.rb', line 69

def to_c
  @pointer
end