Class: Net::IP::Rule
- Inherits:
-
Object
- Object
- Net::IP::Rule
- Defined in:
- lib/net/ip/rule.rb,
lib/net/ip/rule/parser.rb,
lib/net/ip/rule/collection.rb
Overview
Class for working with ip rules.
Defined Under Namespace
Classes: Collection, Parser
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Rule
constructor
Create a new rule object.
- #to_params ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Rule
Note:
This does NOT add the entry to the ip rules. See Net::IP::Rule::Collection#add for creating new rules in the ip rule list.
Create a new rule object
10 11 12 13 14 |
# File 'lib/net/ip/rule.rb', line 10 def initialize(params = {}) params.each do |k,v| instance_variable_set("@#{k}", v) end end |
Instance Method Details
#to_params ⇒ Object
16 17 18 19 20 |
# File 'lib/net/ip/rule.rb', line 16 def to_params str = "" str << "priority #{@priority} " if @priority str end |