Method: Wavefront::Validators#wf_version?
- Defined in:
- lib/wavefront-sdk/validators.rb
#wf_version?(version) ⇒ Boolean
Ensure the given argument is a valid version number
169 170 171 172 173 174 |
# File 'lib/wavefront-sdk/validators.rb', line 169 def wf_version?(version) version = version.to_i if version.is_a?(String) && version =~ /^\d+$/ return true if version.is_a?(Integer) && version.positive? raise Wavefront::Exception::InvalidVersion, version end |