Class: ENM::Enum
- Inherits:
-
Object
- Object
- ENM::Enum
- Extended by:
- Dry::Core::Cache
- Includes:
- Enumerable
- Defined in:
- lib/enm/enum.rb
Overview
An enum type from the database.
Defined Under Namespace
Classes: DryTypeBuilder
Instance Attribute Summary collapse
-
#comment ⇒ String?
readonly
Comment associated with the enum type.
-
#digest ⇒ String
readonly
private
A digest representing the enum values, for caching purposes.
-
#name ⇒ String
readonly
The name of the enum type.
-
#schema ⇒ String
readonly
The schema of the enum type.
Instance Method Summary collapse
Instance Attribute Details
#comment ⇒ String? (readonly)
Returns comment associated with the enum type.
|
|
# File 'lib/enm/enum.rb', line 11
|
#digest ⇒ String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a digest representing the enum values, for caching purposes.
|
|
# File 'lib/enm/enum.rb', line 14
|
#name ⇒ String (readonly)
Returns the name of the enum type.
|
|
# File 'lib/enm/enum.rb', line 18
|
#schema ⇒ String (readonly)
Returns the schema of the enum type.
|
|
# File 'lib/enm/enum.rb', line 21
|
Instance Method Details
#dry(default: nil, mode: :string) ⇒ Dry::Types::Type
30 31 32 33 34 |
# File 'lib/enm/enum.rb', line 30 def dry(default: nil, mode: :string) fetch_or_store([digest, default, mode]) do DryTypeBuilder.new(self, mode:, default:).() end end |