Class: TestParameters::FakeSafeBuffer

Inherits:
Struct
  • Object
show all
Defined in:
test/parameters_test.rb

Overview

emulates ActiveSupport::SafeBuffer#gsub

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stringObject

Returns the value of attribute string

Returns:

  • (Object)

    the current value of string



5
6
7
# File 'test/parameters_test.rb', line 5

def string
  @string
end

Instance Method Details

#gsub(regex) ⇒ Object



7
8
9
10
11
12
# File 'test/parameters_test.rb', line 7

def gsub(regex)
  string.gsub(regex) {
    match, = $&, '' =~ /a/
    yield(match)
  }
end

#to_sObject



6
# File 'test/parameters_test.rb', line 6

def to_s() self end