Class: Vigilem::Win32API::Stat

Inherits:
Core::Stat
  • Object
show all
Extended by:
FFI::Library
Defined in:
lib/vigilem/win32_api/stat.rb

Overview

Stat(us) of Win32API and the handler gem associated with it

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gem_name = 'vigilem-win32_api', opts = {}, &api_check) ⇒ Stat

Returns a new instance of Stat.

Parameters:

  • gem_name, (String)

    defaults to ‘vigilem-win32_api’

  • api_check, (Proc)

    defaults to ‘begin

    not Stat.ffi_lib('Kernel32.dll').empty?
    

    rescue

    false
    

    end`



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vigilem/win32_api/stat.rb', line 21

def initialize(gem_name='vigilem-win32_api', opts={}, &api_check)
  system_name = 'Win32API'
  if block_given?
    super(system_name, gem_name, opts, &api_check)
  else
    super(system_name, gem_name, opts) do 
      begin
        not Stat.ffi_lib('Kernel32.dll').empty?
      rescue LoadError
        false
      end
    end
  end
end

Class Method Details

.defaultStat

Returns:



38
39
40
# File 'lib/vigilem/win32_api/stat.rb', line 38

def self.default
  @default ||= new
end