Class: RubDev::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/rubdev/context.rb

Instance Method Summary collapse

Constructor Details

#initializeContext

Returns a new instance of Context.



24
25
26
# File 'lib/rubdev/context.rb', line 24

def initialize
  @pointer = RubDev::C.udev_new
end

Instance Method Details

#dev_pathObject



56
57
58
# File 'lib/rubdev/context.rb', line 56

def dev_path
  RubDev::C.udev_get_dev_path(@pointer)
end

#log_fn=(fn) ⇒ Object



38
39
40
41
# File 'lib/rubdev/context.rb', line 38

def log_fn= (fn)
  return false unless fn.is_a?(Proc)
  RubDev::C.udev_set_log_fn(@pointer, fn)
end

#log_priorityObject



43
44
45
# File 'lib/rubdev/context.rb', line 43

def log_priority
  RubDev::C.udev_get_log_priority(@pointer)
end

#log_priority=(p) ⇒ Object



47
48
49
50
# File 'lib/rubdev/context.rb', line 47

def log_priority= (p)
  return false unless p.is_a?(Integer)
  RubDev::C.udev_set_log_priority(@pointer, p)
end

#refObject



28
29
30
31
# File 'lib/rubdev/context.rb', line 28

def ref
  RubDev::C.udev_ref(@pointer)
  self
end

#run_pathObject



61
62
63
# File 'lib/rubdev/context.rb', line 61

def run_path
  RubDev::C.udev_get_run_path(@pointer)
end

#sys_pathObject



52
53
54
# File 'lib/rubdev/context.rb', line 52

def sys_path
  RubDev::C.udev_get_sys_path(@pointer)
end

#to_cObject



74
75
76
# File 'lib/rubdev/context.rb', line 74

def to_c
  @pointer
end

#unrefObject



33
34
35
36
# File 'lib/rubdev/context.rb', line 33

def unref
  RubDev::C.udev_unref(@pointer)
  self
end

#userdataObject



66
67
68
# File 'lib/rubdev/context.rb', line 66

def userdata
  RubDev::C.udev_get_userdata(@pointer)
end

#userdata=(data) ⇒ Object



70
71
72
# File 'lib/rubdev/context.rb', line 70

def userdata= (data)
  RubDev::C.udev_get_userdata(@pointer, data)
end