Class: GraphQL::ScalarType

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

Overview

The parent type for scalars, eg STRING_TYPE, INT_TYPE

Instance Attribute Summary collapse

Attributes inherited from ObjectType

#description, #fields, #interfaces

Instance Method Summary collapse

Methods inherited from ObjectType

#==, #to_s

Methods included from DefinitionHelpers::DefinedByConfig

included

Methods included from DefinitionHelpers::NonNullWithBang

#!

Instance Attribute Details

#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