Class: Pio::Match
Overview
Fields to match against flows
Defined Under Namespace
Classes: MatchFormat, MatchIpAddress, Wildcards
Class Method Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Object
rubocop:enable MethodLength.
-
#initialize(user_options) ⇒ Match
constructor
rubocop:disable MethodLength This method smells of :reek:FeatureEnvy This method smells of :reek:DuplicateMethodCall.
Constructor Details
#initialize(user_options) ⇒ Match
rubocop:disable MethodLength This method smells of :reek:FeatureEnvy This method smells of :reek:DuplicateMethodCall
153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/pio/match.rb', line 153 def initialize() flags = Wildcards::FLAGS.each_with_object({}) do |each, memo| memo[each] = true unless .key?(each) end Wildcards::NW_FLAGS.each_with_object(flags) do |each, memo| if .key?(each) memo[each] = 32 - IPv4Address.new([each]).prefixlen else memo["#{each}_all".intern] = true end end @format = MatchFormat.new({ wildcards: flags }.merge ) end |
Class Method Details
.read(binary) ⇒ Object
126 127 128 |
# File 'lib/pio/match.rb', line 126 def self.read(binary) MatchFormat.read binary end |
Instance Method Details
#==(other) ⇒ Object
rubocop:enable MethodLength
168 169 170 171 |
# File 'lib/pio/match.rb', line 168 def ==(other) return false unless other to_binary == other.to_binary end |