Class: Runivedo::Session
- Inherits:
-
Object
- Object
- Runivedo::Session
- Defined in:
- lib/runivedo/session.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #apply_uts(uts) ⇒ Object
- #close ⇒ Object
- #closed? ⇒ Boolean
- #get_perspective(name, &block) ⇒ Object
- #get_server_version ⇒ Object
-
#initialize(url, args = {}) ⇒ Session
constructor
A new instance of Session.
- #ping(v) ⇒ Object
Constructor Details
#initialize(url, args = {}) ⇒ Session
Returns a new instance of Session.
23 24 25 26 27 28 29 30 |
# File 'lib/runivedo/session.rb', line 23 def initialize(url, args = {}) @remote_objects = {} @ws = RfcWebSocket::WebSocket.new(url) Thread.new { handle_ws } @urologin = RemoteObject.new(self, 0) @remote_objects[0] = @urologin @session_remote = @urologin.call_rom('getSession', args) end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
21 22 23 |
# File 'lib/runivedo/session.rb', line 21 def error @error end |
Instance Method Details
#apply_uts(uts) ⇒ Object
40 41 42 |
# File 'lib/runivedo/session.rb', line 40 def apply_uts(uts) @session_remote.apply_uts uts end |
#close ⇒ Object
48 49 50 51 |
# File 'lib/runivedo/session.rb', line 48 def close @ws.close close_ros(Runivedo::ConnectionError.new("connection closed")) end |
#closed? ⇒ Boolean
53 54 55 |
# File 'lib/runivedo/session.rb', line 53 def closed? @ws.closed? end |
#get_perspective(name, &block) ⇒ Object
36 37 38 |
# File 'lib/runivedo/session.rb', line 36 def get_perspective(name, &block) @session_remote.get_perspective name, &block end |
#get_server_version ⇒ Object
44 45 46 |
# File 'lib/runivedo/session.rb', line 44 def get_server_version @session_remote.get_server_version end |
#ping(v) ⇒ Object
32 33 34 |
# File 'lib/runivedo/session.rb', line 32 def ping(v) @session_remote.ping(v) end |