Class: Puppet_X::EnterpriseModules::Oci::ServiceInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet_x/enterprisemodules/oci/service_info.rb

Overview

Docs

Class Method Summary collapse

Class Method Details

.id_to_class(id) ⇒ Object



115
116
117
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 115

def self.id_to_class(id)
  with_id_entry(id) { |e| Object.const_get(e[SDK_MODEL]) }
end

.id_to_client(type) ⇒ Object



123
124
125
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 123

def self.id_to_client(type)
  with_id_entry(type) { |e| Object.const_get(e[SDK_CLIENT]) }
end

.id_to_type(id) ⇒ Object



119
120
121
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 119

def self.id_to_type(id)
  with_id_entry(id) { |e| e[PUPPET_TYPE] }
end

.type_to_class(type) ⇒ Object



103
104
105
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 103

def self.type_to_class(type)
  with_type_entry(type) { |e| Object.const_get(e[SDK_MODEL]) }
end

.type_to_client(type) ⇒ Object



107
108
109
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 107

def self.type_to_client(type)
  with_type_entry(type) { |e| Object.const_get(e[SDK_CLIENT]) }
end

.type_to_id(type) ⇒ Object

rubocop: enable Layout/LineLength



99
100
101
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 99

def self.type_to_id(type)
  with_type_entry(type) { |e| e[OCI_TYPE] }
end

.type_to_lookup_method(type) ⇒ Object



111
112
113
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 111

def self.type_to_lookup_method(type)
  with_type_entry(type) { |e| e[LOOKUP_METHOD] }
end

.with_id_entry(id) {|entry| ... } ⇒ Object

Yields:

  • (entry)


134
135
136
137
138
139
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 134

def self.with_id_entry(id)
  entry = @information.find { |e| e[OCI_TYPE] == id }
  fail "Internal error: No information found for #{id}" if entry.nil?

  yield entry
end

.with_type_entry(type) {|entry| ... } ⇒ Object

Yields:

  • (entry)


127
128
129
130
131
132
# File 'lib/puppet_x/enterprisemodules/oci/service_info.rb', line 127

def self.with_type_entry(type)
  entry = @information.find { |e| e[PUPPET_TYPE] == type }
  fail "Internal error: No information found for #{type}" if entry.nil?

  yield entry
end