Class: UPnP::PortMapping
- Inherits:
-
Object
- Object
- UPnP::PortMapping
- Defined in:
- lib/UPnP.rb
Overview
Represent a port mapping decriptor received from the router.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Internal address.
-
#description ⇒ Object
readonly
Provided description.
-
#duration ⇒ Object
readonly
Duration of the binding.
-
#enabled ⇒ Object
readonly
Is the mapping enabled?.
-
#lport ⇒ Object
readonly
Internal port.
-
#nport ⇒ Object
readonly
External port.
-
#protocol ⇒ Object
readonly
External protocol.
-
#rhost ⇒ Object
readonly
Don’t know …
Instance Method Summary collapse
-
#initialize(cl, lp, np, p, d, e, rh, du) ⇒ PortMapping
constructor
A new instance of PortMapping.
- #to_s ⇒ Object
Constructor Details
#initialize(cl, lp, np, p, d, e, rh, du) ⇒ PortMapping
Returns a new instance of PortMapping.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/UPnP.rb', line 41 def initialize(cl,lp,np,p,d,e,rh,du) @client = cl @lport = lp @nport = np @protocol = p @description = d @enabled = e @rhost = rh @duration = du end |
Instance Attribute Details
#client ⇒ Object (readonly)
Internal address.
18 19 20 |
# File 'lib/UPnP.rb', line 18 def client @client end |
#description ⇒ Object (readonly)
Provided description.
30 31 32 |
# File 'lib/UPnP.rb', line 30 def description @description end |
#duration ⇒ Object (readonly)
Duration of the binding.
39 40 41 |
# File 'lib/UPnP.rb', line 39 def duration @duration end |
#enabled ⇒ Object (readonly)
Is the mapping enabled?.
33 34 35 |
# File 'lib/UPnP.rb', line 33 def enabled @enabled end |
#lport ⇒ Object (readonly)
Internal port.
21 22 23 |
# File 'lib/UPnP.rb', line 21 def lport @lport end |
#nport ⇒ Object (readonly)
External port.
24 25 26 |
# File 'lib/UPnP.rb', line 24 def nport @nport end |
#protocol ⇒ Object (readonly)
External protocol.
27 28 29 |
# File 'lib/UPnP.rb', line 27 def protocol @protocol end |
#rhost ⇒ Object (readonly)
Don’t know …
36 37 38 |
# File 'lib/UPnP.rb', line 36 def rhost @rhost end |
Instance Method Details
#to_s ⇒ Object
52 53 54 |
# File 'lib/UPnP.rb', line 52 def to_s() return "#{@nport}->#{@client}:#{@lport} #{@protocol} for #{@duration} -- #{@description}" end |