Module: GirFFI::FlagsBase
- Includes:
- EnumLikeBase
- Defined in:
- lib/gir_ffi/flags_base.rb
Overview
Instance Method Summary
collapse
#copy_value_to_pointer, #get_value_from_pointer, #setup_and_call, #size, #to_callback_ffi_type, #to_ffi_type, #to_int, #wrap
#setup_method, #setup_method!
#gtype
Methods included from TypeBase
#gir_ffi_builder, #gir_info
Instance Method Details
#[](arg) ⇒ Object
26
27
28
|
# File 'lib/gir_ffi/flags_base.rb', line 26
def [](arg)
self::BitMask[arg]
end
|
#from_native(*args) ⇒ Object
22
23
24
|
# File 'lib/gir_ffi/flags_base.rb', line 22
def from_native(*args)
self::BitMask.from_native(*args).select { |_k, v| v }
end
|
#native_type ⇒ Object
10
11
12
|
# File 'lib/gir_ffi/flags_base.rb', line 10
def native_type
self::BitMask.native_type
end
|
#to_native(value, context) ⇒ Object
14
15
16
17
18
19
20
|
# File 'lib/gir_ffi/flags_base.rb', line 14
def to_native(value, context)
case value
when Symbol
value = { value => true }
end
self::BitMask.to_native(value, context)
end
|