Top Level Namespace

Defined Under Namespace

Modules: IonoscloudDbaasPostgres

Constant Summary collapse

TooManyRequests =
429
BadGateway =
502
ServiceUnavailable =
503
GatewayTimeout =
504

Instance Method Summary collapse

Instance Method Details

#get_class(operation) ⇒ Object



35
36
37
38
39
40
41
42
43
44
# File 'lib/test_driver.rb', line 35

def get_class(operation)
  Ionoscloud.constants.select do |c|
    Ionoscloud.const_get(c).is_a? Class and Ionoscloud.const_get(c).name.end_with? 'Api'
  end.each do |class_symbol|
    class_name = class_symbol.to_s
    methods = Ionoscloud.const_get(class_name).new.methods - Object.methods
    return Ionoscloud.const_get(class_name) if methods.map(&:to_s).include? operation
  end
  nil
end

#underscore_string(str) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/test_driver.rb', line 27

def underscore_string(str)
  str.gsub(/::/, '/')
     .gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
     .gsub(/([a-z\d])([A-Z])/, '\1_\2')
     .tr('-', '_')
     .downcase
end