class Ronin::Support::Network::Wildcard
Represents a wildcard hostname.
## Examples
wildcard = Network::Wildcard.new('*.example.com') wildcard.subdomain('www') # => #<Ronin::Support::Network::Host: www.example.com>
@api public
@since 1.1.0
Attributes
The wildcard template for the hostname.
@return [String]
Public Class Methods
Source
# File lib/ronin/support/network/wildcard.rb, line 53 def initialize(template) @template = template end
Initializes the wildcard hostname.
@param [String] template
The wildcard hostname template.
@example
wildcard = Network::Wildcard.new('*.example.com')
Public Instance Methods
Source
# File lib/ronin/support/network/wildcard.rb, line 71 def subdomain(name) Host.new(@template.sub('*',name)) end
Replaces the ‘*` in the wildcard hostname with the given name.
@param [String] name
The name to replace the `*` wildcard with.
@return [Host]
The new hostname.
@example
wildcard = Network::Wildcard.new('*.example.com') wildcard.subdomain('www') # => #<Ronin::Support::Network::Host: www.example.com>