Module: Google::Cloud::Monitoring::Metric
- Defined in:
- lib/google/cloud/monitoring.rb
Class Method Summary collapse
-
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
Manages metric descriptors, monitored resource descriptors, and time series data.
Class Method Details
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
Manages metric descriptors, monitored resource descriptors, and time series data.
172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/google/cloud/monitoring.rb', line 172 def self.new(*args, version: :v3, **kwargs) unless AVAILABLE_VERSIONS.include?(version.to_s.downcase) raise "The version: #{version} is not available. The available versions " \ "are: [#{AVAILABLE_VERSIONS.join(", ")}]" end require "#{FILE_DIR}/#{version.to_s.downcase}" version_module = Google::Cloud::Monitoring .constants .select {|sym| sym.to_s.downcase == version.to_s.downcase} .first Google::Cloud::Monitoring.const_get(version_module)::Metric.new(*args, **kwargs) end |