Class: Slidr::Commands::InsertCommand

Inherits:
BaseCommand show all
Defined in:
lib/slidr/commands/insert_command.rb

Instance Method Summary collapse

Methods inherited from BaseCommand

#execute

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