# File lib/smart_proxy_dhcp_infoblox/network_address_range_regex_generator.rb, line 51 def initialize(a_node) @value = [a_node.value].flatten @children = a_node.children end
# File lib/smart_proxy_dhcp_infoblox/network_address_range_regex_generator.rb, line 69 def ==(other) return false if self.class != other.class value == other.value end
# File lib/smart_proxy_dhcp_infoblox/network_address_range_regex_generator.rb, line 61 def as_regex children.empty? ? [value_as_regex] : children.map {|c| c.as_regex.map {|r| value_as_regex + r}}.flatten end
# File lib/smart_proxy_dhcp_infoblox/network_address_range_regex_generator.rb, line 56 def merge(other) value.push(other.value).flatten! self end
# File lib/smart_proxy_dhcp_infoblox/network_address_range_regex_generator.rb, line 65 def value_as_regex value.size < 2 ? value.first.to_s : "[#{value.join('')}]" end