Skip to content

Instantly share code, notes, and snippets.

@adam12

adam12/dns.rb Secret

Created August 5, 2019 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam12/d3dca3becf5266b0c9acbd446c87372b to your computer and use it in GitHub Desktop.
Save adam12/d3dca3becf5266b0c9acbd446c87372b to your computer and use it in GitHub Desktop.
# frozen-string-literal: true
module DNS
def self.extract_zones(name)
(parts = name.split("."))
.each_with_index
.map {|p, i| parts[i..-1].join(".") }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment