class Graphlyte::Schema::FragmentParser
Attributes
fragments_dictionary[R]
position[R]
tokens[R]
Public Class Methods
new(tokens)
click to toggle source
# File lib/graphlyte/schema/parser.rb, line 196 def initialize(tokens) @tokens = tokens.flatten(1) @position = 0 @fragments_dictionary = {} end
Public Instance Methods
parse_fragment()
click to toggle source
# File lib/graphlyte/schema/parser.rb, line 207 def parse_fragment if token = expect(:START_FRAGMENT) parse_args builder = Builder.new parse_fields fragment = Fragment.new(token[0][1], token[0][2], builder: builder) @fragments_dictionary[token[0][1]] = fragment need(:END_FRAGMENT) end end
parse_fragments()
click to toggle source
# File lib/graphlyte/schema/parser.rb, line 202 def parse_fragments repeat(:parse_fragment) fragments_dictionary end