Class: Keyring::Key
- Inherits:
-
Object
- Object
- Keyring::Key
- Defined in:
- lib/keyring/key.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(id, value, key_size) ⇒ Key
constructor
A new instance of Key.
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(id, value, key_size) ⇒ Key
Returns a new instance of Key.
5 6 7 8 9 |
# File 'lib/keyring/key.rb', line 5 def initialize(id, value, key_size) @id = Integer(id) @key_size = key_size @value = decode(value) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/keyring/key.rb', line 3 def id @id end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
3 4 5 |
# File 'lib/keyring/key.rb', line 3 def value @value end |
Instance Method Details
#to_s ⇒ Object Also known as: inspect
11 12 13 |
# File 'lib/keyring/key.rb', line 11 def to_s "#<AttrKeyring::Key id=#{id.inspect}>" end |