Class: Ronin::Recon::Values::Domain
- Inherits:
-
Host
- Object
- Ronin::Recon::Value
- Host
- Ronin::Recon::Values::Domain
- Defined in:
- lib/ronin/recon/values/domain.rb
Overview
Represents a domain name (ex: example.com
).
Instance Attribute Summary
Attributes inherited from Host
Class Method Summary collapse
-
.value_type ⇒ :domain
private
Returns the type or kind of recon value.
Instance Method Summary collapse
-
#===(other) ⇒ Boolean
Case equality method used for fuzzy matching.
-
#as_json ⇒ Hash{Symbol => Object}
Coerces the domain value into JSON.
Methods inherited from Host
#eql?, #hash, #initialize, #to_s
Methods inherited from Ronin::Recon::Value
#==, parse, #to_csv, #to_json, #to_s
Constructor Details
This class inherits a constructor from Ronin::Recon::Values::Host
Class Method Details
.value_type ⇒ :domain
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Note:
This is used internally to map a recon value class to a printable type.
Returns the type or kind of recon value.
85 86 87 |
# File 'lib/ronin/recon/values/domain.rb', line 85 def self.value_type :domain end |
Instance Method Details
#===(other) ⇒ Boolean
Case equality method used for fuzzy matching.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/ronin/recon/values/domain.rb', line 46 def ===(other) case other when Domain @name == other.name when Host other.name.end_with?(".#{@name}") when IP, Website, URL if (other_host = other.host) other_host == @name || other_host.end_with?(".#{@name}") end when EmailAddress other.address.end_with?("@#{@name}") || other.address.end_with?(".#{@name}") else false end end |
#as_json ⇒ Hash{Symbol => Object}
Coerces the domain value into JSON.
70 71 72 |
# File 'lib/ronin/recon/values/domain.rb', line 70 def as_json {type: :domain, name: @name} end |