Class: GraphQL::Flamegraph::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/flamegraph/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Result

Returns a new instance of Result.



6
7
8
# File 'lib/graphql/flamegraph/result.rb', line 6

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



4
5
6
# File 'lib/graphql/flamegraph/result.rb', line 4

def raw
  @raw
end

Instance Method Details

#serializeObject Also known as: to_s



10
11
12
# File 'lib/graphql/flamegraph/result.rb', line 10

def serialize
  raw.map { |k, v| "#{k.join(';')} #{v.to_i}\n" }.join
end