Class: Tlux::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/tlux/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = "") ⇒ Session

Returns a new instance of Session.



7
8
9
10
11
# File 'lib/tlux/session.rb', line 7

def initialize(name = "")
  @name = name
  @dir = Dir.pwd
  @windows = []
end

Instance Attribute Details

#dirObject

Returns the value of attribute dir.



3
4
5
# File 'lib/tlux/session.rb', line 3

def dir
  @dir
end

#nameObject



19
20
21
# File 'lib/tlux/session.rb', line 19

def name
  @name.empty? ? name_from_dir : @name
end

#windowsObject (readonly)

Returns the value of attribute windows.



4
5
6
# File 'lib/tlux/session.rb', line 4

def windows
  @windows
end

Instance Method Details

#get_bindingObject



23
24
25
# File 'lib/tlux/session.rb', line 23

def get_binding
  binding
end

#window(name, opts = {}, &block) ⇒ Object



13
14
15
16
17
# File 'lib/tlux/session.rb', line 13

def window(name, opts = {}, &block)
  window = Tlux::Window.new(name, opts)
  @windows << window
  window.instance_eval(&block) if block_given?
end