Module: LogCabin::Modules::Regex
- Defined in:
- lib/prospectus/helpers/regex.rb
Overview
Use regex to adjust state value
Instance Method Summary collapse
Instance Method Details
#regex_helper(value) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/prospectus/helpers/regex.rb', line 6 def regex_helper(value) return value unless @find m = value.match(@find) raise("Value does not match regex: #{value}") unless m m.to_s.sub(@find, @replace) end |