Class: GraphQL::ScalarType

Inherits:
BaseType show all
Defined in:
lib/graphql/scalar_type.rb

Overview

The parent type for scalars, eg STRING_TYPE, INT_TYPE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseType

#==, #resolve_type, #to_s, #unwrap

Methods included from DefinitionHelpers::DefinedByConfig

included

Methods included from DefinitionHelpers::NonNullWithBang

#!

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/graphql/scalar_type.rb', line 6

def description
  @description
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/graphql/scalar_type.rb', line 6

def name
  @name
end

Instance Method Details

#coerce(value) ⇒ Object



8
9
10
# File 'lib/graphql/scalar_type.rb', line 8

def coerce(value)
  @coerce_proc.call(value)
end

#coerce=(proc) ⇒ Object



12
13
14
# File 'lib/graphql/scalar_type.rb', line 12

def coerce=(proc)
  @coerce_proc = proc
end

#kindObject



16
17
18
# File 'lib/graphql/scalar_type.rb', line 16

def kind
  GraphQL::TypeKinds::SCALAR
end