Class: Emasser::Test

Inherits:
SubCommandBase show all
Defined in:
lib/emasser/get.rb

Overview

The Test Connection endpoint is provided by eMASS to verify and troubleshoot the connection to the web service.

Endpoint:

/api - Test connection to the API

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SubCommandBase

banner

Methods included from OutputConverters

#to_output_hash

Methods included from InputConverters

#to_input_hash

Methods included from OptionsParser

#optional_options, #required_options

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/emasser/get.rb', line 36

def self.exit_on_failure?
  true
end

Instance Method Details

#connectionObject



42
43
44
45
46
47
48
# File 'lib/emasser/get.rb', line 42

def connection
  result = EmassClient::TestApi.new.test_connection
  puts to_output_hash(result).green
rescue EmassClient::ApiError => e
  puts 'Exception when calling TestApi->test_connection'.red
  puts to_output_hash(e)
end