Class: Construqt::Firewalls::Firewall
- Inherits:
-
Object
- Object
- Construqt::Firewalls::Firewall
show all
- Defined in:
- lib/construqt/firewalls.rb
Defined Under Namespace
Classes: Forward, Host, Mangle, Nat, Raw
Instance Method Summary
collapse
Constructor Details
#initialize(name) ⇒ Firewall
Returns a new instance of Firewall.
63
64
65
66
67
68
69
70
71
|
# File 'lib/construqt/firewalls.rb', line 63
def initialize(name)
@name = name
@raw = Raw.new(self)
@nat = Nat.new(self)
@forward = Forward.new(self)
@host = Host.new(self)
@ipv4 = true
@ipv6 = true
end
|
Instance Method Details
#forward(&block) ⇒ Object
288
289
290
|
# File 'lib/construqt/firewalls.rb', line 288
def forward(&block)
block.call(@forward)
end
|
#get_forward ⇒ Object
284
285
286
|
# File 'lib/construqt/firewalls.rb', line 284
def get_forward
@forward
end
|
#get_host ⇒ Object
313
314
315
|
# File 'lib/construqt/firewalls.rb', line 313
def get_host
@host
end
|
#get_nat ⇒ Object
197
198
199
|
# File 'lib/construqt/firewalls.rb', line 197
def get_nat
@nat
end
|
#get_raw ⇒ Object
145
146
147
|
# File 'lib/construqt/firewalls.rb', line 145
def get_raw
@raw
end
|
#host(&block) ⇒ Object
317
318
319
|
# File 'lib/construqt/firewalls.rb', line 317
def host(&block)
block.call(@host)
end
|
#ipv4? ⇒ Boolean
73
74
75
|
# File 'lib/construqt/firewalls.rb', line 73
def ipv4?
@ipv4
end
|
#ipv6? ⇒ Boolean
82
83
84
|
# File 'lib/construqt/firewalls.rb', line 82
def ipv6?
@ipv6
end
|
#mangle(&block) ⇒ Object
215
216
217
|
# File 'lib/construqt/firewalls.rb', line 215
def mangle(&block)
block.call(@mangle)
end
|
#name ⇒ Object
91
92
93
|
# File 'lib/construqt/firewalls.rb', line 91
def name
@name
end
|
#nat(&block) ⇒ Object
201
202
203
|
# File 'lib/construqt/firewalls.rb', line 201
def nat(&block)
block.call(@nat)
end
|
#only_ipv4 ⇒ Object
76
77
78
79
80
|
# File 'lib/construqt/firewalls.rb', line 76
def only_ipv4
@ipv4 = true
@ipv6 = false
self.clone
end
|
#only_ipv6 ⇒ Object
85
86
87
88
89
|
# File 'lib/construqt/firewalls.rb', line 85
def only_ipv6
@ipv4 = false
@ipv6 = true
self.clone
end
|
#raw(&block) ⇒ Object
149
150
151
|
# File 'lib/construqt/firewalls.rb', line 149
def raw(&block)
block.call(@raw)
end
|