Class: ITerm2::Session
- Inherits:
-
Object
- Object
- ITerm2::Session
- Defined in:
- lib/iterm2/session.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#tab_id ⇒ Object
readonly
Returns the value of attribute tab_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#window_id ⇒ Object
readonly
Returns the value of attribute window_id.
Instance Method Summary collapse
- #activate(select_tab: true, order_window_front: true) ⇒ Object
- #get_variable(name) ⇒ Object
- #info ⇒ Object
-
#initialize(client:, id:, window_id: nil, tab_id: nil, title: nil) ⇒ Session
constructor
A new instance of Session.
- #read_screen(trailing_lines: nil) ⇒ Object
- #send_text(text, suppress_broadcast: false) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client:, id:, window_id: nil, tab_id: nil, title: nil) ⇒ Session
Returns a new instance of Session.
7 8 9 10 11 12 13 |
# File 'lib/iterm2/session.rb', line 7 def initialize(client:, id:, window_id: nil, tab_id: nil, title: nil) @client = client @id = id @window_id = window_id @tab_id = tab_id @title = title end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/iterm2/session.rb', line 5 def client @client end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/iterm2/session.rb', line 5 def id @id end |
#tab_id ⇒ Object (readonly)
Returns the value of attribute tab_id.
5 6 7 |
# File 'lib/iterm2/session.rb', line 5 def tab_id @tab_id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/iterm2/session.rb', line 5 def title @title end |
#window_id ⇒ Object (readonly)
Returns the value of attribute window_id.
5 6 7 |
# File 'lib/iterm2/session.rb', line 5 def window_id @window_id end |
Instance Method Details
#activate(select_tab: true, order_window_front: true) ⇒ Object
15 16 17 |
# File 'lib/iterm2/session.rb', line 15 def activate(select_tab: true, order_window_front: true) client.activate_session(id, select_tab: select_tab, order_window_front: order_window_front) end |
#get_variable(name) ⇒ Object
31 32 33 |
# File 'lib/iterm2/session.rb', line 31 def get_variable(name) client.get_variable(name, session_id: id) end |
#info ⇒ Object
27 28 29 |
# File 'lib/iterm2/session.rb', line 27 def info client.session_info(id) end |
#read_screen(trailing_lines: nil) ⇒ Object
23 24 25 |
# File 'lib/iterm2/session.rb', line 23 def read_screen(trailing_lines: nil) client.read_screen(id, trailing_lines: trailing_lines) end |
#send_text(text, suppress_broadcast: false) ⇒ Object
19 20 21 |
# File 'lib/iterm2/session.rb', line 19 def send_text(text, suppress_broadcast: false) client.send_text(id, text, suppress_broadcast: suppress_broadcast) end |
#to_h ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/iterm2/session.rb', line 35 def to_h { window_id: window_id, tab_id: tab_id, session_id: id, title: title } end |