Class: Lab42::Tmux::Session
- Inherits:
-
Object
- Object
- Lab42::Tmux::Session
- Extended by:
- Forwarder
- Includes:
- Commands, Hooks, ParameterHelpers
- Defined in:
- lib/lab42/tmux/session.rb,
lib/lab42/tmux/session/hooks.rb,
lib/lab42/tmux/session/commands.rb,
lib/lab42/tmux/session/parameter_helpers.rb
Defined Under Namespace
Modules: Commands, Hooks, ParameterHelpers
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#session_name ⇒ Object
readonly
Returns the value of attribute session_name.
-
#window_number ⇒ Object
readonly
Returns the value of attribute window_number.
Class Method Summary collapse
Instance Method Summary collapse
Methods included from ParameterHelpers
#session_address, #window_address
Methods included from Commands
#goto, #new_window, #really_wait_for, #send_keys, #send_keys_raw, #wait_for
Methods included from Hooks
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
11 12 13 |
# File 'lib/lab42/tmux/session.rb', line 11 def commands @commands end |
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
11 12 13 |
# File 'lib/lab42/tmux/session.rb', line 11 def configuration @configuration end |
#session_name ⇒ Object (readonly)
Returns the value of attribute session_name.
11 12 13 |
# File 'lib/lab42/tmux/session.rb', line 11 def session_name @session_name end |
#window_number ⇒ Object (readonly)
Returns the value of attribute window_number.
11 12 13 |
# File 'lib/lab42/tmux/session.rb', line 11 def window_number @window_number end |
Class Method Details
.instance(an_instance = nil) ⇒ Object
72 73 74 75 |
# File 'lib/lab42/tmux/session.rb', line 72 def instance an_instance=nil return @instance unless an_instance @instance = an_instance end |
.run ⇒ Object
77 78 79 80 |
# File 'lib/lab42/tmux/session.rb', line 77 def run raise Lab42::Tmux::NoSessionDefined, "you need to define a session with `new_session` in your script" unless instance instance.run end |
Instance Method Details
#config(&block) ⇒ Object
16 17 18 |
# File 'lib/lab42/tmux/session.rb', line 16 def config &block block.( configuration ) end |
#run(&block) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/lab42/tmux/session.rb', line 20 def run &block return attach if running? create_session instance_exec( &block ) attach end |