class GraphQL::Client::Schema::SkipDirective

Attributes

of_klass[R]

Internal: Get wrapped klass.

Returns BaseType instance.

Public Class Methods

new(of_klass) click to toggle source

Internal: Construct list wrapper from other BaseType.

of_klass - BaseType instance

# File lib/graphql/client/schema/skip_directive.rb, line 14
def initialize(of_klass)
  unless of_klass.is_a?(BaseType)
    raise TypeError, "expected #{of_klass.inspect} to be a #{BaseType}"
  end

  @of_klass = of_klass
end

Public Instance Methods

cast(value, errors) click to toggle source

Internal: Cast JSON value to wrapped value.

values - JSON value errors - Errors instance

Returns List instance or nil.

# File lib/graphql/client/schema/skip_directive.rb, line 33
def cast(value, errors)
  case value
  when NilClass
    nil
  else
    of_klass.cast(value, errors)
  end
end