Class: GraphQL::GraphQLNonNull
- Inherits:
-
Object
- Object
- GraphQL::GraphQLNonNull
- Includes:
- GraphQLInputType, GraphQLOutputType, GraphQLType
- Defined in:
- lib/graphql/type/non_null.rb
Constant Summary collapse
- NESTING_ERROR =
'Cannot nest NonNull inside NonNull'
Instance Attribute Summary collapse
-
#of_type ⇒ Object
readonly
Returns the value of attribute of_type.
Instance Method Summary collapse
-
#initialize(of_type) ⇒ GraphQLNonNull
constructor
A new instance of GraphQLNonNull.
- #to_s ⇒ Object
Methods included from GraphQLType
Constructor Details
#initialize(of_type) ⇒ GraphQLNonNull
Returns a new instance of GraphQLNonNull.
13 14 15 16 17 |
# File 'lib/graphql/type/non_null.rb', line 13 def initialize(of_type) raise "Expecting #{GraphQLType}, got #{of_type.class}." unless of_type.is_a?(GraphQLType) raise NESTING_ERROR if of_type.is_a?(GraphQLNonNull) @of_type = of_type end |
Instance Attribute Details
#of_type ⇒ Object (readonly)
Returns the value of attribute of_type.
11 12 13 |
# File 'lib/graphql/type/non_null.rb', line 11 def of_type @of_type end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/graphql/type/non_null.rb', line 19 def to_s of_type.to_s + '!' end |