Class: Ronin::Support::Network::Wildcard
- Inherits:
-
Object
- Object
- Ronin::Support::Network::Wildcard
- Defined in:
- lib/ronin/support/network/wildcard.rb
Overview
Instance Attribute Summary collapse
-
#template ⇒ String
readonly
The wildcard template for the hostname.
Instance Method Summary collapse
-
#initialize(template) ⇒ Wildcard
constructor
Initializes the wildcard hostname.
-
#subdomain(name) ⇒ Host
Replaces the
*
in the wildcard hostname with the given name. -
#to_s ⇒ String
Converts the wildcard hostname to a String.
Constructor Details
#initialize(template) ⇒ Wildcard
Initializes the wildcard hostname.
53 54 55 |
# File 'lib/ronin/support/network/wildcard.rb', line 53 def initialize(template) @template = template end |
Instance Attribute Details
#template ⇒ String (readonly)
The wildcard template for the hostname.
42 43 44 |
# File 'lib/ronin/support/network/wildcard.rb', line 42 def template @template end |
Instance Method Details
#subdomain(name) ⇒ Host
Replaces the *
in the wildcard hostname with the given name.
71 72 73 |
# File 'lib/ronin/support/network/wildcard.rb', line 71 def subdomain(name) Host.new(@template.sub('*',name)) end |
#to_s ⇒ String
Converts the wildcard hostname to a String.
81 82 83 |
# File 'lib/ronin/support/network/wildcard.rb', line 81 def to_s @template end |