Class: Pair::Session::HostedSession
- Inherits:
-
Pair::Session
- Object
- Pair::Session
- Pair::Session::HostedSession
- Defined in:
- lib/pair/session/hosted_session.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Attributes inherited from Pair::Session
#host, #name, #options, #participants, #viewers
Instance Method Summary collapse
- #host_login ⇒ Object
-
#initialize(options = {}) ⇒ HostedSession
constructor
A new instance of HostedSession.
- #start! ⇒ Object
- #stop! ⇒ Object
Methods inherited from Pair::Session
Constructor Details
#initialize(options = {}) ⇒ HostedSession
Returns a new instance of HostedSession.
15 16 17 18 19 20 21 22 23 |
# File 'lib/pair/session/hosted_session.rb', line 15 def initialize( = {}) puts "Hosting session #{"called #{[:name].inspect} " if [:name]}..." self.name = .delete(:name) self.viewers = .delete(:viewers) || [] self.participants = .delete(:participants) || [] super() end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
12 13 14 |
# File 'lib/pair/session/hosted_session.rb', line 12 def response @response end |
Instance Method Details
#host_login ⇒ Object
48 49 50 |
# File 'lib/pair/session/hosted_session.rb', line 48 def host_login `whoami`.chomp end |
#start! ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/pair/session/hosted_session.rb', line 25 def start! if setup tunnel.open do tmux.start tmux.attach end else connection_error! end exit end |
#stop! ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/pair/session/hosted_session.rb', line 40 def stop! tmux.stop tunnel.close rescue raise if $-d end |