Class: ActiveGraphql::Client::Actions::Action::FormatOutputs

Inherits:
Object
  • Object
show all
Defined in:
lib/active_graphql/client/actions/action/format_outputs.rb

Overview

converts ruby object in to grapqhl output string

Instance Method Summary collapse

Constructor Details

#initialize(outputs) ⇒ FormatOutputs

Returns a new instance of FormatOutputs.



9
10
11
# File 'lib/active_graphql/client/actions/action/format_outputs.rb', line 9

def initialize(outputs)
  @outputs = outputs
end

Instance Method Details

#callObject



13
14
15
# File 'lib/active_graphql/client/actions/action/format_outputs.rb', line 13

def call
  Array.wrap(outputs).map { |it| formatted(it) }.join(', ')
end