class OSvCRuby::Client

Attributes

config[RW]

The top-level class that handles configuration and connection to the Oracle Service Cloud REST API.

Public Class Methods

new() { |config| ... } click to toggle source
# File lib/osvc_ruby/client.rb, line 12
 def initialize
 raise ArgumentError, "block not given" unless block_given?
 self.config ||= OSvCRuby::Configuration.new
yield(config)

check_config
optional_check
 end

Public Instance Methods

check_config() click to toggle source
# File lib/osvc_ruby/client.rb, line 21
def check_config
   if config.interface ==''
           raise ArgumentError, "Interface cannot be nil or blank"
   elsif config.username ==''
           raise ArgumentError, "Username cannot be nil or blank"
   elsif config.password ==''
           raise ArgumentError, "Password cannot be nil or blank"
   end

   true
end
optional_check() click to toggle source
# File lib/osvc_ruby/client.rb, line 33
def optional_check
   if config.no_ssl_verify.class != FalseClass && config.no_ssl_verify.class != TrueClass
           raise ArgumentError, "The no SSL verification setting must be set to true or false"
   elsif config.version.nil?
           raise ArgumentError, "Connect version cannot be null"
   end
end