Class: Nexpose::IPRange
Overview
Description
Object that represents a single IP address or an inclusive range of IP addresses. If to is nil then the from field will be used to specify a single IP Address only.
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Start of Range *Required.
-
#to ⇒ Object
readonly
End of Range *Optional (If Null then IPRange is a single IP Address).
Instance Method Summary collapse
-
#initialize(from, to = nil) ⇒ IPRange
constructor
A new instance of IPRange.
- #to_xml ⇒ Object
Methods included from Sanitize
Constructor Details
#initialize(from, to = nil) ⇒ IPRange
Returns a new instance of IPRange.
1118 1119 1120 1121 |
# File 'lib/nexpose.rb', line 1118 def initialize(from, to = nil) @from = from @to = to end |
Instance Attribute Details
#from ⇒ Object (readonly)
Start of Range *Required
1114 1115 1116 |
# File 'lib/nexpose.rb', line 1114 def from @from end |
#to ⇒ Object (readonly)
End of Range *Optional (If Null then IPRange is a single IP Address)
1116 1117 1118 |
# File 'lib/nexpose.rb', line 1116 def to @to end |
Instance Method Details
#to_xml ⇒ Object
1124 1125 1126 1127 1128 1129 1130 |
# File 'lib/nexpose.rb', line 1124 def to_xml if (to and not to.empty?) return %Q{<range from="#{from}" to="#{to}"/>} else return %Q{<range from="#{from}"/>} end end |