Class: CLIntegracon::Subject::ReplacementPattern

Inherits:
Struct
  • Object
show all
Defined in:
lib/CLIntegracon/subject.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#patternObject

Returns the value of attribute pattern

Returns:

  • (Object)

    the current value of pattern



4
5
6
# File 'lib/CLIntegracon/subject.rb', line 4

def pattern
  @pattern
end

#replacementObject

Returns the value of attribute replacement

Returns:

  • (Object)

    the current value of replacement



4
5
6
# File 'lib/CLIntegracon/subject.rb', line 4

def replacement
  @replacement
end

Instance Method Details

#replace(output) ⇒ Object

Applies the replacement pattern to the given output, returning a new string with the replacement applied



7
8
9
# File 'lib/CLIntegracon/subject.rb', line 7

def replace(output)
  output.gsub(pattern, replacement)
end