Module: SGC::Helper::IEnum Abstract
- Included in:
- CU::API::Enum, Cuda::API::Enum
- Defined in:
- lib/helpers/interface/ienum.rb
Overview
This module is abstract.
An Enum interface.
An enum maps a symbol to a value, and a value to a symbol.
Instance Method Summary (collapse)
-
- (Symbol, Object) [](key)
The symbol or value that the key maps to.
-
- (Array) symbols
The list of valid symbols of this enum.
Instance Method Details
- (Symbol, Object) [](key)
The symbol or value that the key maps to.
-
If the key is a symbol, return the corresponding value.
-
If the key is a value, return the corresponding symbol.
-
Return nil if the key is invalid.
40 |
# File 'lib/helpers/interface/ienum.rb', line 40 def [](key); raise NotImplementedError; end |
- (Array) symbols
The list of valid symbols of this enum.
33 |
# File 'lib/helpers/interface/ienum.rb', line 33 def symbols; raise NotImplementedError; end |