class GraphQL::Backtrace::Table
A class for turning a context into a human-readable table or array
Constants
- HEADERS
- MAX_COL_WIDTH
- MIN_COL_WIDTH
Public Class Methods
Source
# File lib/graphql/backtrace/table.rb, line 17 def initialize(context, value:) @context = context @override_value = value end
Public Instance Methods
# File lib/graphql/backtrace/table.rb, line 38 def to_backtrace @to_backtrace ||= begin backtrace = rows.map { |r| "#{r[0]}: #{r[1]}" } # skip the header entry backtrace.shift backtrace end end
Returns
-
Array<String>— An array of position + field name entries
Source
# File lib/graphql/backtrace/table.rb, line 28 def to_table @to_table ||= render_table(rows) end
Returns
-
String— A table layout of backtrace with metadata