Module: MorpheusHeroku::Scramblers::Load
Instance Method Summary collapse
- #dev_domain ⇒ Object
- #dev_namespace ⇒ Object
- #scrambled_email ⇒ Object
- #should_scramble_email?(email) ⇒ Boolean
Instance Method Details
#dev_domain ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/morpheus-heroku/scramblers/email.rb', line 22 def dev_domain @dev_domain ||= if MorpheusHeroku.configuration.dev_email "@" + MorpheusHeroku.configuration.dev_email.match(/(.*)@(.*)/)[2] else "" end end |
#dev_namespace ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/morpheus-heroku/scramblers/email.rb', line 30 def dev_namespace @dev_namespace ||= if MorpheusHeroku.configuration.dev_email MorpheusHeroku.configuration.dev_email.match(/(.*)@(.*)/)[1] else "" end end |
#scrambled_email ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/morpheus-heroku/scramblers/email.rb', line 6 def scrambled_email if dev_namespace.present? && dev_domain.present? "#{dev_namespace}+#{random_string}@#{dev_domain}" else "dev+#{random_string}@example.com" end end |
#should_scramble_email?(email) ⇒ Boolean
14 15 16 17 18 19 20 |
# File 'lib/morpheus-heroku/scramblers/email.rb', line 14 def should_scramble_email?(email) if dev_domain.present? email.include?(dev_domain) else false end end |