Class: Leeloo::GitSecretDecorator
Instance Method Summary collapse
- #erase ⇒ Object
-
#initialize(git, secret) ⇒ GitSecretDecorator
constructor
A new instance of GitSecretDecorator.
- #name ⇒ Object
- #read ⇒ Object
- #write(phrase) ⇒ Object
Methods inherited from Secret
Constructor Details
#initialize(git, secret) ⇒ GitSecretDecorator
Returns a new instance of GitSecretDecorator.
78 79 80 81 |
# File 'lib/leeloo/secret.rb', line 78 def initialize git, secret @git = git @secret = secret end |
Instance Method Details
#erase ⇒ Object
97 98 99 100 101 |
# File 'lib/leeloo/secret.rb', line 97 def erase @secret.erase @git.remove @secret.pathname @git.commit "secret #{@secret.name} removed" end |
#name ⇒ Object
83 84 85 |
# File 'lib/leeloo/secret.rb', line 83 def name @secret.name end |
#read ⇒ Object
87 88 89 |
# File 'lib/leeloo/secret.rb', line 87 def read @secret.read end |
#write(phrase) ⇒ Object
91 92 93 94 95 |
# File 'lib/leeloo/secret.rb', line 91 def write phrase @secret.write phrase @git.add @secret.pathname @git.commit "secret #{@secret.name} added" end |