Class: ForemanVault::VaultAuthMethod
- Inherits:
-
Object
- Object
- ForemanVault::VaultAuthMethod
- Defined in:
- app/services/foreman_vault/vault_auth_method.rb
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(host) ⇒ VaultAuthMethod
constructor
A new instance of VaultAuthMethod.
- #name ⇒ Object
- #save ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(host) ⇒ VaultAuthMethod
Returns a new instance of VaultAuthMethod.
5 6 7 |
# File 'app/services/foreman_vault/vault_auth_method.rb', line 5 def initialize(host) @host = host end |
Instance Method Details
#delete ⇒ Object
25 26 27 28 29 |
# File 'app/services/foreman_vault/vault_auth_method.rb', line 25 def delete return false unless valid? delete_certificate(name) end |
#name ⇒ Object
13 14 15 16 17 |
# File 'app/services/foreman_vault/vault_auth_method.rb', line 13 def name return unless host host.name.parameterize end |
#save ⇒ Object
19 20 21 22 23 |
# File 'app/services/foreman_vault/vault_auth_method.rb', line 19 def save return false unless valid? set_certificate(name, ) end |
#valid? ⇒ Boolean
9 10 11 |
# File 'app/services/foreman_vault/vault_auth_method.rb', line 9 def valid? name.present? && [:certificate].present? end |