Class: Slidr::Commands::InsertCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- Slidr::Commands::InsertCommand
- Defined in:
- lib/slidr/commands/insert_command.rb
Instance Method Summary collapse
- #go(content) ⇒ Object
-
#initialize(pattern, value) ⇒ InsertCommand
constructor
A new instance of InsertCommand.
Methods inherited from BaseCommand
Constructor Details
#initialize(pattern, value) ⇒ InsertCommand
Returns a new instance of InsertCommand.
6 7 8 9 |
# File 'lib/slidr/commands/insert_command.rb', line 6 def initialize(pattern, value) @pattern = pattern @value = value end |
Instance Method Details
#go(content) ⇒ Object
11 12 13 |
# File 'lib/slidr/commands/insert_command.rb', line 11 def go(content) content.sub(@pattern, @value) end |