Class: Mantra::Certificates::Cortege
- Inherits:
-
Object
- Object
- Mantra::Certificates::Cortege
- Defined in:
- lib/mantra/certificates/cortege.rb
Instance Attribute Summary collapse
-
#certificate ⇒ Object
Returns the value of attribute certificate.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
Instance Method Summary collapse
- #has_certificate? ⇒ Boolean
- #has_private_key? ⇒ Boolean
- #has_public_key? ⇒ Boolean
-
#initialize(options) ⇒ Cortege
constructor
A new instance of Cortege.
- #matches? ⇒ Boolean
Constructor Details
#initialize(options) ⇒ Cortege
Returns a new instance of Cortege.
8 9 10 11 12 |
# File 'lib/mantra/certificates/cortege.rb', line 8 def initialize() self.public_key = [:public_key] self.private_key = [:private_key] self.certificate = [:certificate] end |
Instance Attribute Details
#certificate ⇒ Object
Returns the value of attribute certificate.
7 8 9 |
# File 'lib/mantra/certificates/cortege.rb', line 7 def certificate @certificate end |
#private_key ⇒ Object
Returns the value of attribute private_key.
7 8 9 |
# File 'lib/mantra/certificates/cortege.rb', line 7 def private_key @private_key end |
#public_key ⇒ Object
Returns the value of attribute public_key.
7 8 9 |
# File 'lib/mantra/certificates/cortege.rb', line 7 def public_key @public_key end |
Instance Method Details
#has_certificate? ⇒ Boolean
25 26 27 |
# File 'lib/mantra/certificates/cortege.rb', line 25 def has_certificate? !!self.certificate end |
#has_private_key? ⇒ Boolean
33 34 35 |
# File 'lib/mantra/certificates/cortege.rb', line 33 def has_private_key? !!self.private_key end |
#has_public_key? ⇒ Boolean
29 30 31 |
# File 'lib/mantra/certificates/cortege.rb', line 29 def has_public_key? !!self.public_key end |
#matches? ⇒ Boolean
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/mantra/certificates/cortege.rb', line 14 def matches? if self.has_private_key? && self.has_certificate? return private_key_matches_certificate? elsif self.has_private_key? && self.has_public_key? return private_key_matches_public_key? else puts "Warning: don't know what to do with following certificate cortege #{self.inspect}" return false end end |