Class: Ace::Tmux::Models::RuntimeTarget
- Inherits:
-
Object
- Object
- Ace::Tmux::Models::RuntimeTarget
- Defined in:
- lib/ace/tmux/models/runtime_target.rb
Instance Attribute Summary collapse
-
#pane ⇒ Object
readonly
Returns the value of attribute pane.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
-
#initialize(session: nil, window: nil, pane: nil, source:, raw_window_target: nil) ⇒ RuntimeTarget
constructor
A new instance of RuntimeTarget.
- #pane_target ⇒ Object
- #session_target ⇒ Object
- #window_target ⇒ Object
Constructor Details
#initialize(session: nil, window: nil, pane: nil, source:, raw_window_target: nil) ⇒ RuntimeTarget
Returns a new instance of RuntimeTarget.
9 10 11 12 13 14 15 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 9 def initialize(session: nil, window: nil, pane: nil, source:, raw_window_target: nil) @session = presence(session) @window = presence(window) @pane = presence(pane) @source = source.to_s @raw_window_target = presence(raw_window_target) end |
Instance Attribute Details
#pane ⇒ Object (readonly)
Returns the value of attribute pane.
7 8 9 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 7 def pane @pane end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
7 8 9 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 7 def session @session end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 7 def source @source end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
7 8 9 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 7 def window @window end |
Instance Method Details
#pane_target ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 28 def pane_target return pane if pane&.start_with?("%") return pane if pane&.start_with?("@") return pane if pane&.include?(":") return nil unless pane && window_target "#{window_target}.#{pane}" end |
#session_target ⇒ Object
17 18 19 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 17 def session_target session end |
#window_target ⇒ Object
21 22 23 24 25 26 |
# File 'lib/ace/tmux/models/runtime_target.rb', line 21 def window_target return @raw_window_target if @raw_window_target return nil unless session && window "#{session}:#{window}" end |