Class: Ccrypto::SecretKey

Inherits:
Object
  • Object
show all
Defined in:
lib/ccrypto/ruby/ext/secret_key.rb

Instance Method Summary collapse

Instance Method Details

#equals?(key) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/ccrypto/ruby/ext/secret_key.rb', line 19

def equals?(key)
  to_bin == key
end

#lengthObject



15
16
17
# File 'lib/ccrypto/ruby/ext/secret_key.rb', line 15

def length
  to_bin.length
end

#to_binObject



6
7
8
9
10
11
12
13
# File 'lib/ccrypto/ruby/ext/secret_key.rb', line 6

def to_bin
  case @key
  when String
    @key
  else
    @key.key
  end
end