Class: GraphQL::EnumType::EnumValue

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/enum_type.rb

Overview

A value within an GraphQL::EnumType

Created with the `value` helper

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, description:, deprecation_reason:, value:) ⇒ EnumValue

Returns a new instance of EnumValue.


135
136
137
138
139
140
# File 'lib/graphql/enum_type.rb', line 135

def initialize(name:, description:, deprecation_reason:, value:)
  @name = name
  @description = description
  @deprecation_reason = deprecation_reason
  @value = value
end

Instance Attribute Details

#deprecation_reasonObject

Returns the value of attribute deprecation_reason


134
135
136
# File 'lib/graphql/enum_type.rb', line 134

def deprecation_reason
  @deprecation_reason
end

#descriptionObject

Returns the value of attribute description


134
135
136
# File 'lib/graphql/enum_type.rb', line 134

def description
  @description
end

#nameObject

Returns the value of attribute name


134
135
136
# File 'lib/graphql/enum_type.rb', line 134

def name
  @name
end

#valueObject

Returns the value of attribute value


134
135
136
# File 'lib/graphql/enum_type.rb', line 134

def value
  @value
end

Class Method Details

.define(name:, description: nil, deprecation_reason: nil, value: nil) ⇒ Object


130
131
132
# File 'lib/graphql/enum_type.rb', line 130

def self.define(name:, description: nil, deprecation_reason: nil, value: nil)
  new(name: name, description: description, deprecation_reason: deprecation_reason, value: value)
end