Module: GraphQL::Define::InstanceDefinable
- Included in:
- Argument, BaseType, GraphQL::Directive, Field, Relay::GlobalNodeIdentification, Relay::Mutation
- Defined in:
- lib/graphql/define/instance_definable.rb
Overview
This module provides the ‘.define { … }` API for BaseType, Field, Argument and GraphQL::Directive.
The goals are:
-
Minimal overhead in consuming classes
-
Independence between consuming classes
-
Extendable by third-party libraries without monkey-patching or other nastiness
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#definition_proc=(defn_block) ⇒ Object
Set the definition block for this instance.
Class Method Details
.included(base) ⇒ Object
43 44 45 |
# File 'lib/graphql/define/instance_definable.rb', line 43 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#definition_proc=(defn_block) ⇒ Object
Set the definition block for this instance. It can be run later with #ensure_defined
49 50 51 |
# File 'lib/graphql/define/instance_definable.rb', line 49 def definition_proc=(defn_block) @definition_proc = defn_block end |