class Dizby::TunnelFactory
Public Class Methods
new(server, port)
click to toggle source
# File lib/dizby/tunnel/factory.rb, line 13 def initialize(server, port) @server = server @port = port end
Public Instance Methods
bidirectional?()
click to toggle source
# File lib/dizby/tunnel/factory.rb, line 22 def bidirectional? @server.respond_to?(:port) end
create(type)
click to toggle source
# File lib/dizby/tunnel/factory.rb, line 18 def create(type) SemibuiltObject.new(type, @server, strategy) end
strategy()
click to toggle source
# File lib/dizby/tunnel/factory.rb, line 26 def strategy if bidirectional? BidirectionalTunnelStrategy.new(@port, @server.port) else LocalTunnelStrategy.new(@port) end end