Class: Keyring::Key
- Inherits:
-
Object
- Object
- Keyring::Key
- Defined in:
- lib/keyring/key.rb
Instance Attribute Summary collapse
-
#encryption_key ⇒ Object
readonly
Returns the value of attribute encryption_key.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#signing_key ⇒ Object
readonly
Returns the value of attribute signing_key.
Instance Method Summary collapse
-
#initialize(id, key, key_size) ⇒ Key
constructor
A new instance of Key.
- #to_s ⇒ Object (also: #inspect)
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_key ⇒ Object (readonly)
Returns the value of attribute encryption_key.
5 6 7 |
# File 'lib/keyring/key.rb', line 5 def encryption_key @encryption_key end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/keyring/key.rb', line 5 def id @id end |
#signing_key ⇒ Object (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_s ⇒ Object Also known as: inspect
13 14 15 |
# File 'lib/keyring/key.rb', line 13 def to_s "#<Keyring::Key id=#{id.inspect}>" end |