Class: Pair::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/pair/session.rb,
lib/pair/session/tmux.rb,
lib/pair/session/tunnel.rb,
lib/pair/session/hosted_session.rb,
lib/pair/session/authorized_keys_file.rb

Direct Known Subclasses

HostedSession

Defined Under Namespace

Classes: AuthorizedKeysFile, HostedSession, Tmux, Tunnel

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Session

Returns a new instance of Session.



11
12
13
# File 'lib/pair/session.rb', line 11

def initialize(options = {})
  self.options = options
end

Instance Attribute Details

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/pair/session.rb', line 8

def host
  @host
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/pair/session.rb', line 8

def name
  @name
end

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/pair/session.rb', line 8

def options
  @options
end

#participantsObject

Returns the value of attribute participants.



8
9
10
# File 'lib/pair/session.rb', line 8

def participants
  @participants
end

#viewersObject

Returns the value of attribute viewers.



8
9
10
# File 'lib/pair/session.rb', line 8

def viewers
  @viewers
end

Class Method Details

.host(options) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/pair/session/hosted_session.rb', line 3

def self.host(options)
  session = HostedSession.new(options)
  at_exit { session.stop! }

  session.start!
  session.stop!
end