Class: Washcloth::Filters::ReplaceEachCharacter
- Inherits:
-
Object
- Object
- Washcloth::Filters::ReplaceEachCharacter
- Defined in:
- lib/washcloth.rb
Instance Method Summary collapse
- #[](value) ⇒ Object
-
#initialize(replacement) ⇒ ReplaceEachCharacter
constructor
A new instance of ReplaceEachCharacter.
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 |