Module: Ordrin::Mutate
- Defined in:
- lib/ordrin/mutate.rb
Class Method Summary collapse
Class Method Details
.identity(value) ⇒ Object
19 20 21 |
# File 'lib/ordrin/mutate.rb', line 19 def identity(value) value end |
.phone(value) ⇒ Object
15 16 17 |
# File 'lib/ordrin/mutate.rb', line 15 def phone(value) value.gsub(/\D/, '').gsub(/^(\d{3})(\d{3})(\d{4})$/, '\1-\2-\3'); end |
.sha256(value) ⇒ Object
7 8 9 |
# File 'lib/ordrin/mutate.rb', line 7 def sha256(value) Digest::SHA256.new.hexdigest(value) end |
.state(value) ⇒ Object
11 12 13 |
# File 'lib/ordrin/mutate.rb', line 11 def state(value) value.upcase end |