Class: VCloudSdk::IpRanges
- Inherits:
-
Object
- Object
- VCloudSdk::IpRanges
- Defined in:
- lib/ruby_vcloud_sdk/ip_ranges.rb
Instance Attribute Summary collapse
-
#ranges ⇒ Object
readonly
Returns the value of attribute ranges.
Instance Method Summary collapse
- #add(ip_ranges) ⇒ Object (also: #+)
- #include?(ip_ranges) ⇒ Boolean
-
#initialize(value = nil) ⇒ IpRanges
constructor
A new instance of IpRanges.
- #subtract(ip_ranges) ⇒ Object (also: #-)
Constructor Details
#initialize(value = nil) ⇒ IpRanges
Returns a new instance of IpRanges.
8 9 10 11 12 |
# File 'lib/ruby_vcloud_sdk/ip_ranges.rb', line 8 def initialize(value = nil) @ranges = Set.new parse_ip_ranges(value) unless value.nil? end |
Instance Attribute Details
#ranges ⇒ Object
Returns the value of attribute ranges.
6 7 8 |
# File 'lib/ruby_vcloud_sdk/ip_ranges.rb', line 6 def ranges @ranges end |
Instance Method Details
#add(ip_ranges) ⇒ Object Also known as: +
14 15 16 17 18 19 20 |
# File 'lib/ruby_vcloud_sdk/ip_ranges.rb', line 14 def add(ip_ranges) ip_ranges = objectify ip_ranges result = IpRanges.new result.ranges.merge @ranges result.ranges.merge ip_ranges.ranges result end |
#include?(ip_ranges) ⇒ Boolean
33 34 35 36 |
# File 'lib/ruby_vcloud_sdk/ip_ranges.rb', line 33 def include?(ip_ranges) ip_ranges = objectify ip_ranges @ranges.superset? ip_ranges.ranges end |