class GraphQL::Language::Visitor::NodeVisitor
Collect `enter` and `leave` hooks for classes in {GraphQL::Language::Nodes}
Access {NodeVisitor}s via {GraphQL::Language::Visitor#[]}
Attributes
enter[R]
@return [Array<Proc>] Hooks to call when entering a node of this type
leave[R]
@return [Array<Proc>] Hooks to call when leaving a node of this type
Public Class Methods
new()
click to toggle source
# File lib/graphql/language/visitor.rb, line 77 def initialize @enter = [] @leave = [] end
Public Instance Methods
<<(hook)
click to toggle source
Shorthand to add a hook to the {#enter} array @param hook [Proc] A hook to add
# File lib/graphql/language/visitor.rb, line 84 def <<(hook) enter << hook end