Class: Reyes::IPTables::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/reyes/iptables.rb

Constant Summary collapse

IPTABLES =
"iptables"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cmd) ⇒ Rule

Returns a new instance of Rule.



81
82
83
# File 'lib/reyes/iptables.rb', line 81

def initialize(cmd)
  @cmd = cmd
end

Instance Attribute Details

#cmdObject (readonly)

Returns the value of attribute cmd.



80
81
82
# File 'lib/reyes/iptables.rb', line 80

def cmd
  @cmd
end

Instance Method Details

#materializeObject



85
86
87
88
# File 'lib/reyes/iptables.rb', line 85

def materialize
  cmd = [IPTABLES] + @cmd
  Subprocess.check_call(cmd)
end