Class: FFI::Enums
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb
Overview
Instance Method Summary collapse
-
#<<(enum) ⇒ Object
Add an Enum to the collection.
-
#__map_symbol(symbol) ⇒ Object
A symbol.
-
#find(query) ⇒ Enum
Find a Enum in collection.
- #initialize ⇒ nil constructor
Constructor Details
Instance Method Details
#<<(enum) ⇒ Object
Add an FFI::Enum to the collection.
47 48 49 50 51 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb', line 47 def <<(enum) @all_enums << enum @tagged_enums[enum.tag] = enum unless enum.tag.nil? @symbol_map.merge!(enum.symbol_map) end |
#__map_symbol(symbol) ⇒ Object
Returns a symbol.
66 67 68 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb', line 66 def __map_symbol(symbol) @symbol_map[symbol] end |
#find(query) ⇒ Enum
Find a FFI::Enum in collection.
56 57 58 59 60 61 62 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/ffi-1.15.5/lib/ffi/enum.rb', line 56 def find(query) if @tagged_enums.has_key?(query) @tagged_enums[query] else @all_enums.detect { |enum| enum.symbols.include?(query) } end end |