Class: Linzer::Key
- Inherits:
-
Object
- Object
- Linzer::Key
- Defined in:
- lib/linzer/key.rb,
lib/linzer/key/helper.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Helper
Instance Attribute Summary collapse
-
#material ⇒ Object
readonly
Returns the value of attribute material.
Instance Method Summary collapse
-
#initialize(material, params = {}) ⇒ Key
constructor
A new instance of Key.
- #key_id ⇒ Object
- #sign(*args) ⇒ Object
- #verify(*args) ⇒ Object
Constructor Details
#initialize(material, params = {}) ⇒ Key
Returns a new instance of Key.
5 6 7 8 9 10 |
# File 'lib/linzer/key.rb', line 5 def initialize(material, params = {}) @material = material @params = Hash(params).clone.freeze validate freeze end |
Instance Attribute Details
#material ⇒ Object (readonly)
Returns the value of attribute material.
12 13 14 |
# File 'lib/linzer/key.rb', line 12 def material @material end |
Instance Method Details
#key_id ⇒ Object
14 15 16 |
# File 'lib/linzer/key.rb', line 14 def key_id @params[:id] end |
#sign(*args) ⇒ Object
18 19 20 21 |
# File 'lib/linzer/key.rb', line 18 def sign(*args) abstract_error = "Cannot sign data, \"#{self.class}\" is an abstract class." raise Error.new abstract_error end |
#verify(*args) ⇒ Object
23 24 25 26 |
# File 'lib/linzer/key.rb', line 23 def verify(*args) abstract_error = "Cannot verify signature, \"#{self.class}\" is an abstract class." raise Error.new abstract_error end |