Class: DnsMock::Representer::RdnsLookup

Inherits:
Object
  • Object
show all
Defined in:
lib/dns_mock/representer/rdns_lookup.rb

Constant Summary collapse

IP_OCTET_GROUPS =
/(\d+).(\d+).(\d+).(\d+)/.freeze
RDNS_LOOKUP_REPRESENTATION =
'\4.\3.\2.\1.in-addr.arpa'

Class Method Summary collapse

Class Method Details

.call(host_address) ⇒ Object



9
10
11
12
13
14
# File 'lib/dns_mock/representer/rdns_lookup.rb', line 9

def self.call(host_address)
  host_address.gsub(
    DnsMock::Representer::RdnsLookup::IP_OCTET_GROUPS,
    DnsMock::Representer::RdnsLookup::RDNS_LOOKUP_REPRESENTATION
  )
end