Class: TmuxConnector::Send
- Inherits:
-
Object
- Object
- TmuxConnector::Send
- Defined in:
- lib/tmux-connector/commands/send.rb
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#filter_predicate ⇒ Object
readonly
Returns the value of attribute filter_predicate.
-
#group_filter ⇒ Object
readonly
Returns the value of attribute group_filter.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#server_filter ⇒ Object
readonly
Returns the value of attribute server_filter.
-
#session ⇒ Object
readonly
Returns the value of attribute session.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
-
#window ⇒ Object
readonly
Returns the value of attribute window.
Instance Method Summary collapse
-
#initialize(args) ⇒ Send
constructor
A new instance of Send.
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ Send
Returns a new instance of Send.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/tmux-connector/commands/send.rb', line 16 def initialize(args) @name = args['<session-name>'] @verbose = args['--verbose'] load_commands args process_server_filter args['--server-filter'] rescue raise "error parsing server filter ('#{ args['--server-filter'] }')" @group_filter = Regexp.new(args['--group-filter']) rescue nil @server_filter ||= Regexp.new(args['--filter']) rescue nil @group_filter ||= Regexp.new(args['--filter']) rescue nil @window = args['--window'] @session = Session.load_by_name args['<session-name>'] end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
7 8 9 |
# File 'lib/tmux-connector/commands/send.rb', line 7 def commands @commands end |
#filter_predicate ⇒ Object (readonly)
Returns the value of attribute filter_predicate.
8 9 10 |
# File 'lib/tmux-connector/commands/send.rb', line 8 def filter_predicate @filter_predicate end |
#group_filter ⇒ Object (readonly)
Returns the value of attribute group_filter.
9 10 11 |
# File 'lib/tmux-connector/commands/send.rb', line 9 def group_filter @group_filter end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/tmux-connector/commands/send.rb', line 10 def name @name end |
#server_filter ⇒ Object (readonly)
Returns the value of attribute server_filter.
11 12 13 |
# File 'lib/tmux-connector/commands/send.rb', line 11 def server_filter @server_filter end |
#session ⇒ Object (readonly)
Returns the value of attribute session.
12 13 14 |
# File 'lib/tmux-connector/commands/send.rb', line 12 def session @session end |
#verbose ⇒ Object (readonly)
Returns the value of attribute verbose.
13 14 15 |
# File 'lib/tmux-connector/commands/send.rb', line 13 def verbose @verbose end |
#window ⇒ Object (readonly)
Returns the value of attribute window.
14 15 16 |
# File 'lib/tmux-connector/commands/send.rb', line 14 def window @window end |
Instance Method Details
#run ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/tmux-connector/commands/send.rb', line 34 def run() opts = { verbose: verbose, filter_predicate: filter_predicate } session.tmux_session.send_commands(commands, server_filter, group_filter, window, opts) end |