Class: Efl::Elm::ElmStore

Inherits:
Object
  • Object
show all
Includes:
ClassHelper
Defined in:
lib/efl/elm/elm_store.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ClassHelper

#===, #address, included, #method_missing, #null?, #to_a, #to_ary, #to_ptr, #to_s

Constructor Details

#initialize(o = nil, &block) ⇒ ElmStore

Returns a new instance of ElmStore.



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/efl/elm/elm_store.rb', line 16

def initialize o=nil, &block
    @ptr = (
        case o
        when NilClass
            FFI::AutoPointer.new Native.elm_store_filesystem_new, ElmStore.method(:release)
        when FFI::Pointer
            o
        else
            raise ArgumentError.new "wrong argument #{o.class.name}"
        end
    )
    instance_eval &block if block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Efl::ClassHelper

Class Method Details

.release(p) ⇒ Object



29
30
31
# File 'lib/efl/elm/elm_store.rb', line 29

def self.release p
    Native.elm_store_free p
end

Instance Method Details

#freeObject



32
33
34
35
36
# File 'lib/efl/elm/elm_store.rb', line 32

def free
    @ptr.autorelease=false if @ptr.is_a? FFI::AutoPointer
    ElmStore.release @ptr
    @ptr=nil
end