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
-
#[](key) ⇒ Symbol, Object
The symbol or value that the key maps to.
-
#symbols ⇒ Array
The list of valid symbols of this enum.
Instance Method Details
#[](key) ⇒ Symbol, Object
Returns 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 |
#symbols ⇒ Array
Returns The list of valid symbols of this enum.
33 |
# File 'lib/helpers/interface/ienum.rb', line 33 def symbols; raise NotImplementedError; end |