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.
5 6 7 8 9 |
# File 'lib/keyring/key.rb', line 5 def initialize(id, key, key_size) @id = Integer(id) @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.
3 4 5 |
# File 'lib/keyring/key.rb', line 3 def encryption_key @encryption_key end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/keyring/key.rb', line 3 def id @id end |
#signing_key ⇒ Object (readonly)
Returns the value of attribute signing_key.
3 4 5 |
# File 'lib/keyring/key.rb', line 3 def signing_key @signing_key end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
11 12 13 |
# File 'lib/keyring/key.rb', line 11 def to_s "#<Keyring::Key id=#{id.inspect}>" end |