Class: NetHTTP::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/core/core.rb,
lib/core/utilities.rb

Defined Under Namespace

Classes: Utilities

Class Method Summary collapse

Class Method Details

.get_logger(logger = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/core/core.rb', line 7

def self.get_logger(logger = nil)
  return logger if logger.class == Logger

  if logger.nil? || logger.to_s.empty?
    logger = Logger.new(STDOUT)
    logger.level = Logger::INFO
  end

  logger
end

.schema_validation(opts, schema) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/core/core.rb', line 18

def self.schema_validation(opts, schema)
  results = schema.call(opts)
  if results.success?
    return nil
  else
    return results.messages
  end
end