Class: Travis::Client::Repository::Key
- Inherits:
-
Object
- Object
- Travis::Client::Repository::Key
- Defined in:
- lib/travis/client/repository.rb
Instance Attribute Summary collapse
-
#to_s ⇒ Object
readonly
Returns the value of attribute to_s.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #encrypt(value) ⇒ Object
-
#initialize(data) ⇒ Key
constructor
A new instance of Key.
- #to_rsa ⇒ Object
- #to_ssh ⇒ Object
Constructor Details
#initialize(data) ⇒ Key
Returns a new instance of Key.
10 11 12 |
# File 'lib/travis/client/repository.rb', line 10 def initialize(data) @to_s = data end |
Instance Attribute Details
#to_s ⇒ Object (readonly)
Returns the value of attribute to_s.
8 9 10 |
# File 'lib/travis/client/repository.rb', line 8 def to_s @to_s end |
Instance Method Details
#==(other) ⇒ Object
27 28 29 |
# File 'lib/travis/client/repository.rb', line 27 def ==(other) other.to_s == self end |
#encrypt(value) ⇒ Object
14 15 16 17 |
# File 'lib/travis/client/repository.rb', line 14 def encrypt(value) encrypted = to_rsa.public_encrypt(value) Base64.encode64(encrypted).gsub(/\s+/, "") end |
#to_rsa ⇒ Object
19 20 21 |
# File 'lib/travis/client/repository.rb', line 19 def to_rsa Tools::SSLKey.public_rsa_key(to_s) end |