Class: Converter
- Inherits:
-
Object
- Object
- Converter
- Defined in:
- lib/vimamsa/text_transforms.rb
Instance Method Summary collapse
- #apply(txt) ⇒ Object
-
#initialize(obj, type, id = nil) ⇒ Converter
constructor
A new instance of Converter.
Constructor Details
Instance Method Details
#apply(txt) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/vimamsa/text_transforms.rb', line 10 def apply(txt) if @type == :gsub return txt.gsub(@obj[0], @obj[1]) elsif @type == :lambda return @obj.call(txt) end end |