Class: Shhh::App::PrivateKey::Base64Decoder

Inherits:
Struct
  • Object
show all
Defined in:
lib/shhh/app/private_key/base64_decoder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#encoded_keyObject

Returns the value of attribute encoded_key

Returns:

  • (Object)

    the current value of encoded_key


4
5
6
# File 'lib/shhh/app/private_key/base64_decoder.rb', line 4

def encoded_key
  @encoded_key
end

Instance Method Details

#keyObject


6
7
8
9
10
11
12
13
# File 'lib/shhh/app/private_key/base64_decoder.rb', line 6

def key
  return nil if encoded_key.nil?
  begin
    Base64.urlsafe_decode64(encoded_key)
  rescue ArgumentError
    encoded_key
  end
end