Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/analyzer.rb,
lib/analyzer.rb

Overview

Utility for extrapolating MongoType need dates…

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.set_encryptionObject

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

#correctObject



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

#decryptObject



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

#encryptObject



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

#md5Object

some normalization of SS entries necessary



42
43
44
# File 'lib/analyzer.rb', line 42

def md5
Gibberish::MD5 (self.gsub "-","").strip()
end