Class: Keyring::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/keyring/key.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, key, key_size) ⇒ Key

Returns a new instance of Key.



7
8
9
10
11
# File 'lib/keyring/key.rb', line 7

def initialize(id, key, key_size)
  @id = Integer(id.to_s)
  @key_size = key_size
  @encryption_key, @signing_key = parse_key(key)
end

Instance Attribute Details

#encryption_keyObject (readonly)

Returns the value of attribute encryption_key.



5
6
7
# File 'lib/keyring/key.rb', line 5

def encryption_key
  @encryption_key
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/keyring/key.rb', line 5

def id
  @id
end

#signing_keyObject (readonly)

Returns the value of attribute signing_key.



5
6
7
# File 'lib/keyring/key.rb', line 5

def signing_key
  @signing_key
end

Instance Method Details

#to_sObject Also known as: inspect



13
14
15
# File 'lib/keyring/key.rb', line 13

def to_s
  "#<Keyring::Key id=#{id.inspect}>"
end