Class: Types::BaseEnum
- Inherits:
-
GraphQL::Schema::Enum
- Object
- GraphQL::Schema::Enum
- Types::BaseEnum
- Defined in:
- app/graphql/types/base_enum.rb
Direct Known Subclasses
AccessLevelEnum, Admin::Analytics::InstanceStatistics::MeasurementIdentifierEnum, AlertManagement::SeverityEnum, AlertManagement::StatusEnum, Types::BlobViewers::TypeEnum, Ci::PipelineConfigSourceEnum, Ci::PipelineStatusEnum, CommitActionModeEnum, CommitEncodingEnum, ContainerExpirationPolicyCadenceEnum, ContainerExpirationPolicyKeepEnum, ContainerExpirationPolicyOlderThanEnum, DesignManagement::DesignVersionEventEnum, ErrorTracking::SentryErrorStatusEnum, IssuableSeverityEnum, IssuableStateEnum, IssueTypeEnum, MilestoneStateEnum, MutationOperationModeEnum, Notes::PositionTypeEnum, PackageTypeEnum, Projects::NamespaceProjectSortEnum, Projects::ServiceTypeEnum, ReleaseAssetLinkTypeEnum, Snippets::BlobActionEnum, Snippets::TypeEnum, Snippets::VisibilityScopesEnum, SortEnum, TodoActionEnum, TodoStateEnum, TodoTargetEnum, Tree::TypeEnum, UserStateEnum, VisibilityLevelsEnum
Class Method Summary collapse
-
.enum ⇒ Object
Returns an indifferent access hash with the key being the downcased name of the attribute and the value being the Ruby value (either the explicit `value` passed or the same as the value attr).
- .value(*args, **kwargs, &block) ⇒ Object
Class Method Details
.enum ⇒ Object
Returns an indifferent access hash with the key being the downcased name of the attribute and the value being the Ruby value (either the explicit `value` passed or the same as the value attr).
14 15 16 |
# File 'app/graphql/types/base_enum.rb', line 14 def enum @enum_values ||= {}.with_indifferent_access end |
.value(*args, **kwargs, &block) ⇒ Object
6 7 8 9 10 |
# File 'app/graphql/types/base_enum.rb', line 6 def value(*args, **kwargs, &block) enum[args[0].downcase] = kwargs[:value] || args[0] super(*args, **kwargs, &block) end |