Class: NetworkProjector::NPConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/network-projector/server/app.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ NPConnection

Returns a new instance of NPConnection.



10
11
12
13
14
15
16
17
# File 'lib/network-projector/server/app.rb', line 10

def initialize options = {}
	@id   = UUID.generate
	@label = options[:label]
	@host = options[:host]
	@port = options[:port]
	@passwd = options[:passwd]
	@client = VncClient.new
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def client
  @client
end

#hostObject (readonly)

Returns the value of attribute host.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def host
  @host
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def id
  @id
end

#labelObject (readonly)

Returns the value of attribute label.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def label
  @label
end

#passwdObject (readonly)

Returns the value of attribute passwd.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def passwd
  @passwd
end

#portObject (readonly)

Returns the value of attribute port.



8
9
10
# File 'lib/network-projector/server/app.rb', line 8

def port
  @port
end

Instance Method Details

#runObject



23
24
25
# File 'lib/network-projector/server/app.rb', line 23

def run
	@client.run :host => @host, :port => @port, :passwd => @passwd
end

#statusObject



19
20
21
# File 'lib/network-projector/server/app.rb', line 19

def status
	@client.started? ? "Started" : "Stopped"
end