Module: Trackman::Scaffold::ContentSaver::ClassMethods
- Defined in:
- lib/trackman/scaffold/content_saver.rb
Instance Method Summary collapse
- #edit(selector, &block) ⇒ Object
- #gsub(pattern, replacement) ⇒ Object
- #remove(selector, &predicate) ⇒ Object
Instance Method Details
#edit(selector, &block) ⇒ Object
23 24 25 26 |
# File 'lib/trackman/scaffold/content_saver.rb', line 23 def edit selector, &block raise 'block parameter is mandatory' unless block_given? nodes_to_edit[selector] = block end |
#gsub(pattern, replacement) ⇒ Object
27 28 29 |
# File 'lib/trackman/scaffold/content_saver.rb', line 27 def gsub pattern, replacement text_to_edit[pattern] = replacement end |
#remove(selector, &predicate) ⇒ Object
30 31 32 |
# File 'lib/trackman/scaffold/content_saver.rb', line 30 def remove selector, &predicate nodes_to_remove[selector] = predicate end |