Write a method that takes a string as input. It should return true if
the input is a valid IPv4 address (ie. anything between 0.0.0.0
and
255.255.255.255
is valid).
Run rspec
in this directory to see failing tests. If you do not have rspec
run gem install rspec
and try it again. Once you see failing tests write code in the ip_address_validator.rb
file to make them pass. Feel free to checkout /spec/ip_address_validator_spec.rb
to see the sample tests that have been written.
Make sure your code is
- DRY
- Named semantically
- Small