Method: Wavefront::Validators#wf_granularity?

Defined in:
lib/wavefront-sdk/validators.rb

#wf_granularity?(granularity) ⇒ Boolean

Ensure the given argument is a valid query granularity

Parameters:

  • granularity (String)

    granularity

Returns:

  • (Boolean)

    true if valid

Raises:

  • Wavefront::Exceptions::InvalidGranularity if not valid



352
353
354
355
356
# File 'lib/wavefront-sdk/validators.rb', line 352

def wf_granularity?(granularity)
  return true if %w[d h m s].include?(granularity.to_s)

  raise Wavefront::Exception::InvalidGranularity, granularity
end