Class: Ellipses::Client::Commands::Substitute

Inherits:
Ellipses::Client::Command show all
Includes:
Ellipses::Client::Command::Mixins::SetupPattern
Defined in:
lib/ellipses/client/commands/substitute.rb

Constant Summary

Constants inherited from Ellipses::Client::Command

Ellipses::Client::Command::Error

Instance Attribute Summary

Attributes inherited from Ellipses::Client::Command

#argv, #server

Instance Method Summary collapse

Methods included from Ellipses::Client::Command::Mixins::SetupPattern

#patternize

Methods inherited from Ellipses::Client::Command

#error, #initialize, #to_s

Methods included from Ellipses::Client::Command::DSL

#command

Constructor Details

This class inherits a constructor from Ellipses::Client::Command

Instance Method Details

#call(input) ⇒ Object



17
18
19
# File 'lib/ellipses/client/commands/substitute.rb', line 17

def call(input)
  input.map { |line| line.gsub param.pattern, param.replace }
end

#setupObject



11
12
13
14
15
# File 'lib/ellipses/client/commands/substitute.rb', line 11

def setup
  super

  param.replace = argv.last
end