Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/analyzer.rb,
lib/analyzer.rb
Overview
Utility for extrapolating MongoType need dates…
Class Method Summary collapse
-
.set_encryption ⇒ Object
cypher p p.
Instance Method Summary collapse
- #correct ⇒ Object
- #decrypt ⇒ Object
- #encrypt ⇒ Object
-
#md5 ⇒ Object
some normalization of SS entries necessary.
Class Method Details
.set_encryption ⇒ Object
cypher p p
29 30 31 32 |
# File 'lib/analyzer.rb', line 29 def self.set_encryption cypher=prompt "enter encryption cypher: " $e = BiCrypt.new(cypher) end |
Instance Method Details
#correct ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/analyzer.rb', line 60 def correct case self when "String" "String" when "Fixnum" "Integer" end end |
#decrypt ⇒ Object
33 34 35 36 |
# File 'lib/analyzer.rb', line 33 def decrypt if $e==nil then String.set_encryption end $e.decrypt_string Base64.decode64 self.encode('ascii-8bit') end |
#encrypt ⇒ Object
37 38 39 40 |
# File 'lib/analyzer.rb', line 37 def encrypt if $e==nil then String.set_encryption end Base64.encode64($e.encrypt_string(self)).encode('utf-8') end |
#md5 ⇒ Object
some normalization of SS entries necessary
42 43 44 |
# File 'lib/analyzer.rb', line 42 def md5 Gibberish::MD5 (self.gsub "-","").strip() end |