Method: SecureString#initialize
- Defined in:
- lib/secure_string.rb
#initialize(mode = :data, value) ⇒ SecureString
Creates the string from one many kinds of values:
- :data
-
(default) The passed string value is directly used.
- :hex
-
Initialize using a hexidecimal string.
- :int
-
Initialize using the numeric value of the hexidecimal string.
- :base64
-
Initialize using the given base64 encoded data.
15 16 17 18 |
# File 'lib/secure_string.rb', line 15 def initialize(mode = :data, value) data_string = self.class.parse_data(mode, value) self.replace( data_string ) end |