Module: Olyx::Guardrails::Pii::Ipv4Validator
- Defined in:
- lib/olyx/guardrails/pii/ipv4_validator.rb
Overview
Validates the structure and range of every IPv4 octet.
Class Method Summary collapse
Class Method Details
.call(address) ⇒ Object
10 11 12 13 |
# File 'lib/olyx/guardrails/pii/ipv4_validator.rb', line 10 def call(address) octets = address.split('.') octets.length == 4 && octets.all? { |octet| octet.to_i.between?(0, 255) } end |