Class: Confium::CFM

Inherits:
Object
  • Object
show all
Defined in:
lib/confium/cfm.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCFM

Returns a new instance of CFM.



7
8
9
10
11
# File 'lib/confium/cfm.rb', line 7

def initialize
  pptr = ::FFI::MemoryPointer.new(:pointer)
  Confium.call_ffi(:cfm_create, pptr)
  @ptr = ::FFI::AutoPointer.new(pptr.read_pointer, self.class.method(:destroy))
end

Instance Attribute Details

#ptrObject (readonly)

Returns the value of attribute ptr.



5
6
7
# File 'lib/confium/cfm.rb', line 5

def ptr
  @ptr
end

Class Method Details

.destroy(ptr) ⇒ Object



13
14
15
# File 'lib/confium/cfm.rb', line 13

def self.destroy(ptr)
  Confium::Lib.cfm_destroy(ptr)
end

Instance Method Details

#load_plugin(name, path) ⇒ Object



17
18
19
# File 'lib/confium/cfm.rb', line 17

def load_plugin(name, path)
  Confium.call_ffi(:cfm_plugin_load, @ptr, name, path, nil, nil)
end