Class: Washcloth::Filters::ReplaceEachCharacter

Inherits:
Object
  • Object
show all
Defined in:
lib/washcloth.rb

Instance Method Summary collapse

Constructor Details

#initialize(replacement) ⇒ ReplaceEachCharacter

Returns a new instance of ReplaceEachCharacter.



117
118
119
# File 'lib/washcloth.rb', line 117

def initialize(replacement)
  @replacement = replacement
end

Instance Method Details

#[](value) ⇒ Object



121
122
123
# File 'lib/washcloth.rb', line 121

def [](value)
  value.chars.map { @replacement }.join
end