Sha256: f920164cb42067faa740d30f142c475d63421cd78cc8f26846d3eb39eee85d35

Contents?: true

Size: 367 Bytes

Versions: 3

Compression:

Stored size: 367 Bytes

Contents

class FormatResponse < Struct.new(:response, :options)

  def self.call(*args)
    new(*args).call
  end

  def call
    formated_json = JSON.pretty_generate(response)
    if response['status'] == 500 || response['status'] == 403
      puts Rainbow(formated_json).red
      exit
    else
      puts Rainbow(formated_json).green if options[:verbose]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
imuzer-0.0.4 lib/format_response.rb
imuzer-0.0.3 lib/format_response.rb
imuzer-0.0.2 lib/format_response.rb