Module: MetasploitDataModels::IPAddress::Range::ClassMethods
- Defined in:
- lib/metasploit_data_models/ip_address/range.rb
Overview
Class methods added to the including Class
.
Instance Method Summary collapse
-
#extreme_class ⇒ Class
The
Class
for each extreme (Range#begin
andRange#end
) of the range. -
#extreme_class_name ⇒ String?
The name of #extreme_class.
-
#extremes(options = {}) ⇒ void
Sets #extreme_class_name.
-
#match_regexp ⇒ Regexp
Regular expression that matches a string exactly when it contains an IP address range with the correct #extreme_class.
-
#regexp ⇒ Regexp
Regular expression match a SEPARATOR separated range with #extreme_class parseable
Range#begin
andRange#end
.
Instance Method Details
#extreme_class ⇒ Class
Call #extremes first to set #extreme_class_name.
The Class
for each extreme (Range#begin
and Range#end
) of the range.
71 72 73 |
# File 'lib/metasploit_data_models/ip_address/range.rb', line 71 def extreme_class @extreme_class ||= extreme_class_name.constantize end |
#extreme_class_name ⇒ String?
The name of #extreme_class.
79 80 81 |
# File 'lib/metasploit_data_models/ip_address/range.rb', line 79 def extreme_class_name @extreme_class_name end |
#extremes(options = {}) ⇒ void
This method returns an undefined value.
Sets #extreme_class_name.
91 92 93 94 95 |
# File 'lib/metasploit_data_models/ip_address/range.rb', line 91 def extremes(={}) .assert_valid_keys(:class_name) @extreme_class_name = .fetch(:class_name) end |
#match_regexp ⇒ Regexp
Call #extremes first to set #extreme_class_name.
Regular expression that matches a string exactly when it contains an IP address range with the correct #extreme_class.
62 63 64 |
# File 'lib/metasploit_data_models/ip_address/range.rb', line 62 def match_regexp @match_regexp ||= /\A#{regexp}\z/ end |
#regexp ⇒ Regexp
Call #extremes first to set #extreme_class_name.
Regular expression match a SEPARATOR separated range with #extreme_class parseable Range#begin
and
Range#end
.
103 104 105 |
# File 'lib/metasploit_data_models/ip_address/range.rb', line 103 def regexp @regexp ||= /#{extreme_class.regexp}#{SEPARATOR}#{extreme_class.regexp}/ end |