Class: GraphqlRails::Model::BuildEnumType

Inherits:
Object
  • Object
show all
Includes:
Service
Defined in:
lib/graphql_rails/model/build_enum_type.rb

Overview

contains info about single graphql attribute

Defined Under Namespace

Classes: InvalidEnum

Instance Method Summary collapse

Constructor Details

#initialize(name, allowed_values:, description: nil) ⇒ BuildEnumType

Returns a new instance of BuildEnumType.



15
16
17
18
19
# File 'lib/graphql_rails/model/build_enum_type.rb', line 15

def initialize(name, allowed_values:, description: nil)
  @name = name
  @allowed_values = allowed_values
  @description = description
end

Instance Method Details

#callObject



21
22
23
24
# File 'lib/graphql_rails/model/build_enum_type.rb', line 21

def call
  validate
  build_enum
end