lib/puffy/rule.rb in puffy-0.3.1 vs lib/puffy/rule.rb in puffy-1.0.0

- old
+ new

@@ -62,11 +62,10 @@ # # Rule.new({ action: :accept, dir: :in, proto: :tcp, to: { port: 80 } }) def initialize(options = {}) send_options(options) - @af = detect_af unless af - + self.af ||= detect_af self.proto ||= from_proto_hint || to_proto_hint raise "unsupported action `#{options[:action]}'" unless valid_action? raise 'if from_port or to_port is specified, the protocol must also be given' if port_without_protocol? end