Class: BlueWall::Rule
- Inherits:
-
Struct
- Object
- Struct
- BlueWall::Rule
- Defined in:
- lib/bluewall.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#direction ⇒ Object
Returns the value of attribute direction.
-
#dport ⇒ Object
Returns the value of attribute dport.
-
#gateway ⇒ Object
Returns the value of attribute gateway.
-
#id ⇒ Object
Returns the value of attribute id.
-
#interface ⇒ Object
Returns the value of attribute interface.
-
#nat_rule ⇒ Object
Returns the value of attribute nat_rule.
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#quick ⇒ Object
Returns the value of attribute quick.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#source ⇒ Object
Returns the value of attribute source.
-
#state_type ⇒ Object
Returns the value of attribute state_type.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
10 11 12 |
# File 'lib/bluewall.rb', line 10 def action @action end |
#comment ⇒ Object
Returns the value of attribute comment
10 11 12 |
# File 'lib/bluewall.rb', line 10 def comment @comment end |
#destination ⇒ Object
Returns the value of attribute destination
10 11 12 |
# File 'lib/bluewall.rb', line 10 def destination @destination end |
#direction ⇒ Object
Returns the value of attribute direction
10 11 12 |
# File 'lib/bluewall.rb', line 10 def direction @direction end |
#dport ⇒ Object
Returns the value of attribute dport
10 11 12 |
# File 'lib/bluewall.rb', line 10 def dport @dport end |
#gateway ⇒ Object
Returns the value of attribute gateway
10 11 12 |
# File 'lib/bluewall.rb', line 10 def gateway @gateway end |
#id ⇒ Object
Returns the value of attribute id
10 11 12 |
# File 'lib/bluewall.rb', line 10 def id @id end |
#interface ⇒ Object
Returns the value of attribute interface
10 11 12 |
# File 'lib/bluewall.rb', line 10 def interface @interface end |
#nat_rule ⇒ Object
Returns the value of attribute nat_rule
10 11 12 |
# File 'lib/bluewall.rb', line 10 def nat_rule @nat_rule end |
#protocol ⇒ Object
Returns the value of attribute protocol
10 11 12 |
# File 'lib/bluewall.rb', line 10 def protocol @protocol end |
#quick ⇒ Object
Returns the value of attribute quick
10 11 12 |
# File 'lib/bluewall.rb', line 10 def quick @quick end |
#schedule ⇒ Object
Returns the value of attribute schedule
10 11 12 |
# File 'lib/bluewall.rb', line 10 def schedule @schedule end |
#source ⇒ Object
Returns the value of attribute source
10 11 12 |
# File 'lib/bluewall.rb', line 10 def source @source end |
#state_type ⇒ Object
Returns the value of attribute state_type
10 11 12 |
# File 'lib/bluewall.rb', line 10 def state_type @state_type end |
Instance Method Details
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/bluewall.rb', line 11 def to_s parts = ["[#{id}] #{action} #{direction} on #{interface}"] parts << "proto=#{protocol}" if protocol && protocol != 'any' parts << "src=#{source}" if source && source != 'any' parts << "dst=#{destination}" if destination && destination != 'any' parts << "dport=#{dport}" if dport parts << "(Comment: #{comment})" if comment parts << "(Quick)" if quick parts << "(Schedule: #{schedule})" if schedule parts << "(Gateway: #{gateway})" if gateway parts << "(State: #{state_type})" parts << "(NAT Rule)" if nat_rule parts.join(" ") end |