Class: SpecViews::ViewSanitizer
- Inherits:
-
Object
- Object
- SpecViews::ViewSanitizer
- Defined in:
- app/models/spec_views/view_sanitizer.rb
Instance Method Summary collapse
- #gsub(*args, &block) ⇒ Object
-
#initialize ⇒ ViewSanitizer
constructor
A new instance of ViewSanitizer.
- #sanitize(string) ⇒ Object
Constructor Details
#initialize ⇒ ViewSanitizer
Returns a new instance of ViewSanitizer.
7 8 9 |
# File 'app/models/spec_views/view_sanitizer.rb', line 7 def initialize @sanitizers = [] end |
Instance Method Details
#gsub(*args, &block) ⇒ Object
11 12 13 |
# File 'app/models/spec_views/view_sanitizer.rb', line 11 def gsub(*args, &block) @sanitizers << [:gsub, args, block] end |
#sanitize(string) ⇒ Object
15 16 17 18 19 20 |
# File 'app/models/spec_views/view_sanitizer.rb', line 15 def sanitize(string) each do |sanitize_method, args, block| string = string.send(sanitize_method, *args, &block) end string end |