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.
5 6 7 |
# File 'app/models/spec_views/view_sanitizer.rb', line 5 def initialize @sanitizers = [] end |
Instance Method Details
#gsub(*args, &block) ⇒ Object
9 10 11 |
# File 'app/models/spec_views/view_sanitizer.rb', line 9 def gsub(*args, &block) @sanitizers << [:gsub, args, block] end |
#sanitize(string) ⇒ Object
13 14 15 16 17 18 |
# File 'app/models/spec_views/view_sanitizer.rb', line 13 def sanitize(string) each do |sanitize_method, args, block| string = string.send(sanitize_method, *args, &block) end string end |