123456789_123456789_123456789_123456789_123456789_

Module: FFI::Platform

Relationships & Source Files
Defined in: lib/ffi/platform.rb,
ext/ffi_c/Platform.c

Overview

This module defines different constants and class methods to play with various platforms.

Constant Summary

Class Attribute Summary

Class Method Summary

Class Attribute Details

.bsd?Boolean (readonly)

Test if current OS is a *BSD (include MAC)

[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 158

def self.bsd?
  IS_BSD
end

.mac?Boolean (readonly)

Test if current OS is Mac OS

[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 170

def self.mac?
  IS_MAC
end

.solaris?Boolean (readonly)

Test if current OS is Solaris (Sun OS)

[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 176

def self.solaris?
  IS_SOLARIS
end

.unix?Boolean (readonly)

Test if current OS is a unix OS

[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 182

def self.unix?
  !IS_WINDOWS
end

.windows?Boolean (readonly)

Test if current OS is Windows

[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 164

def self.windows?
  IS_WINDOWS
end

Class Method Details

.is_os(os) ⇒ Boolean (private)

Test if current OS is os.

Parameters:

  • os (String)
[ GitHub ]

  
# File 'lib/ffi/platform.rb', line 92

def self.is_os(os)
  OS == os
end