Class: Ronin::Recon::Config::Workers Private
- Inherits:
-
Object
- Object
- Ronin::Recon::Config::Workers
- Includes:
- Enumerable
- Defined in:
- lib/ronin/recon/config.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Represents the set of workers to use.
Constant Summary collapse
- DEFAULT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The default workers configuration.
Set[ # NOTE: disabled due to rate limiting issues # 'api/crt_sh', 'dns/lookup', 'dns/mailservers', 'dns/nameservers', 'dns/reverse_lookup', 'dns/srv_enum', 'dns/subdomain_enum', 'dns/suffix_enum', 'net/ip_range_enum', 'net/port_scan', 'net/service_id', 'ssl/cert_grab', 'ssl/cert_enum', 'web/dir_enum', 'web/email_addresses', 'web/spider' ]
Instance Attribute Summary collapse
-
#ids ⇒ Set<String>
readonly
private
The set of worker IDs.
Class Method Summary collapse
-
.default ⇒ Workers
private
Initializes the default workers.
Instance Method Summary collapse
-
#add(worker_id) ⇒ self
Adds a worker to the workers.
-
#delete(worker_id) ⇒ Object
Deletes a worker from the workers.
-
#each {|worker_id| ... } ⇒ Enumerator
private
Enumerates over each worker in the set.
-
#eql?(other) ⇒ Boolean
(also: #==)
private
Compares the workers to another object.
-
#include?(worker_id) ⇒ Boolean
Determines if the worker is enabled in the workers.
-
#initialize(workers) ⇒ Workers
constructor
private
Initializes the workers.
Constructor Details
#initialize(workers) ⇒ Workers
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.
Initializes the workers.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/ronin/recon/config.rb', line 56 def initialize(workers) case workers when Set then @ids = workers.dup when Array then @ids = workers.to_set when Hash @ids = DEFAULT.dup workers.each do |worker_id,enabled| if enabled then add(worker_id) else delete(worker_id) end end else raise(ArgumentError,"workers value must be a Set, Array, or Hash: #{workers.inspect}") end end |
Instance Attribute Details
#ids ⇒ Set<String> (readonly)
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.
The set of worker IDs.
45 46 47 |
# File 'lib/ronin/recon/config.rb', line 45 def ids @ids end |
Class Method Details
Instance Method Details
#add(worker_id) ⇒ self
Adds a worker to the workers.
113 114 115 116 |
# File 'lib/ronin/recon/config.rb', line 113 def add(worker_id) @ids.add(worker_id) return self end |
#delete(worker_id) ⇒ Object
Deletes a worker from the workers.
126 127 128 129 |
# File 'lib/ronin/recon/config.rb', line 126 def delete(worker_id) @ids.delete(worker_id) return self end |
#each {|worker_id| ... } ⇒ Enumerator
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.
Enumerates over each worker in the set.
157 158 159 |
# File 'lib/ronin/recon/config.rb', line 157 def each(&block) @ids.each(&block) end |
#eql?(other) ⇒ Boolean Also known as: ==
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.
Compares the workers to another object.
169 170 171 |
# File 'lib/ronin/recon/config.rb', line 169 def eql?(other) self.class == other.class && @ids == other.ids end |
#include?(worker_id) ⇒ Boolean
Determines if the worker is enabled in the workers.
141 142 143 |
# File 'lib/ronin/recon/config.rb', line 141 def include?(worker_id) @ids.include?(worker_id) end |