Class: GitWrapper::Commands::Reset

Inherits:
Git
  • Object
show all
Defined in:
lib/git_wrapper/commands/reset.rb

Instance Attribute Summary

Attributes inherited from Git

#error, #location_folder, #output

Instance Method Summary collapse

Methods inherited from Git

#execute, #initialize, #result, #success?

Constructor Details

This class inherits a constructor from GitWrapper::Commands::Git

Instance Method Details

#commandObject



30
31
32
# File 'lib/git_wrapper/commands/reset.rb', line 30

def command
  "reset #{@mode ? "--#{@mode}" : ''} #{@commit}"
end

#commit(commit) ⇒ Object



5
6
7
8
# File 'lib/git_wrapper/commands/reset.rb', line 5

def commit(commit)
  @commit = commit
  self
end

#hardObject



15
16
17
18
# File 'lib/git_wrapper/commands/reset.rb', line 15

def hard
  @mode = :hard
  self
end

#keepObject



25
26
27
28
# File 'lib/git_wrapper/commands/reset.rb', line 25

def keep
  @mode = :keep
  self
end

#mergeObject



20
21
22
23
# File 'lib/git_wrapper/commands/reset.rb', line 20

def merge
  @mode = :merge
  self
end

#softObject



10
11
12
13
# File 'lib/git_wrapper/commands/reset.rb', line 10

def soft
  @mode = :soft
  self
end