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.
268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/google/cloud/monitoring.rb', line 268 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 |