Class: Leeloo::GitSecretDecorator

Inherits:
Secret
  • Object
show all
Defined in:
lib/leeloo/secret.rb

Instance Method Summary collapse

Methods inherited from Secret

#==

Constructor Details

#initialize(git, secret) ⇒ GitSecretDecorator

Returns a new instance of GitSecretDecorator.



89
90
91
92
# File 'lib/leeloo/secret.rb', line 89

def initialize git, secret
  @git = git
  @secret = secret
end

Instance Method Details

#eraseObject



112
113
114
115
116
# File 'lib/leeloo/secret.rb', line 112

def erase
  @secret.erase
  @git.remove @secret.pathname
  @git.commit "secret #{@secret.name} removed"
end

#footprintObject



102
103
104
# File 'lib/leeloo/secret.rb', line 102

def footprint
  @secret.footprint
end

#nameObject



94
95
96
# File 'lib/leeloo/secret.rb', line 94

def name
  @secret.name
end

#readObject



98
99
100
# File 'lib/leeloo/secret.rb', line 98

def read
  @secret.read
end

#write(phrase) ⇒ Object



106
107
108
109
110
# File 'lib/leeloo/secret.rb', line 106

def write phrase
  @secret.write phrase
  @git.add @secret.pathname
  @git.commit "secret #{@secret.name} added"
end