Class: Rexpro::Session
- Inherits:
-
Object
- Object
- Rexpro::Session
- Defined in:
- lib/rexpro/session.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#languages ⇒ Object
readonly
Returns the value of attribute languages.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #execute(script, attrs = {}) ⇒ Object
-
#initialize(client, uuid, languages = nil) ⇒ Session
constructor
A new instance of Session.
- #kill ⇒ Object
Constructor Details
#initialize(client, uuid, languages = nil) ⇒ Session
Returns a new instance of Session.
6 7 8 |
# File 'lib/rexpro/session.rb', line 6 def initialize(client, uuid, languages = nil) @client, @uuid, @languages = client, uuid, languages end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
4 5 6 |
# File 'lib/rexpro/session.rb', line 4 def client @client end |
#languages ⇒ Object (readonly)
Returns the value of attribute languages.
4 5 6 |
# File 'lib/rexpro/session.rb', line 4 def languages @languages end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
4 5 6 |
# File 'lib/rexpro/session.rb', line 4 def uuid @uuid end |
Instance Method Details
#execute(script, attrs = {}) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/rexpro/session.rb', line 16 def execute(script, attrs = {}) attrs = attrs.merge( session_uuid: uuid, in_session: true, script: script) msg = Rexpro::Message::ScriptRequest.new(attrs) client.request(msg) end |
#kill ⇒ Object
10 11 12 13 14 |
# File 'lib/rexpro/session.rb', line 10 def kill attrs = {session_uuid: uuid, kill_session: true} msg = Rexpro::Message::SessionRequest.new(attrs) client.request(msg) end |