Class: ESS::Validation::TextIsValidLongitude

Inherits:
Object
  • Object
show all
Defined in:
lib/ess/validation.rb

Instance Method Summary collapse

Instance Method Details

#validate(tag) ⇒ Object



63
64
65
66
67
# File 'lib/ess/validation.rb', line 63

def validate tag
  unless tag.text! =~ /^-?((1?[0-7]?|[0-9]?)[0-9]|180)\.[0-9]{1,6}$/
    raise InvalidValueError, "invalid longitude: #{tag.text!}"
  end
end