Class: Ro::Git::Patch
- Inherits:
-
Object
- Object
- Ro::Git::Patch
- Defined in:
- lib/ro/git.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ Patch
constructor
A new instance of Patch.
- #save(path) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Patch
Returns a new instance of Patch.
158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/ro/git.rb', line 158 def initialize(*args) = Map.(args) self.class.fattrs.each do |key| send(key, .get(key)) if .has?(key) end unless args.empty? self.data = args.join end end |
Instance Method Details
#save(path) ⇒ Object
170 171 172 173 174 175 |
# File 'lib/ro/git.rb', line 170 def save(path) return false unless data path = path.to_s FileUtils.mkdir_p(File.dirname(path)) IO.binwrite(path, data) end |