Class: Vermillion::Controller::Change
- Includes:
- Helper::ApiCommunication
- Defined in:
- lib/client/controller/change.rb
Constant Summary
Constants inherited from Base
Base::OK, Base::QUIT, Base::QUIT_SOFT
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#branch(server, to = nil) ⇒ Object
- Change branches on the selected server
server
- Symbol representing the server you want to access
to
-
Optional symbol, what branch should we change to?.
- Symbol representing the server you want to access
- Change branches on the selected server
-
#pre_exec ⇒ Object
Prepare to execute the requested method.
Methods included from Helper::ApiCommunication
Methods inherited from Base
#can_exec?, #exec, #initialize, #post_exec, #sample
Constructor Details
This class inherits a constructor from Vermillion::Controller::Base
Instance Method Details
#branch(server, to = nil) ⇒ Object
Change branches on the selected server
server
-
Symbol representing the server you want to access
to
-
Optional symbol, what branch should we change to?
20 21 22 23 |
# File 'lib/client/controller/change.rb', line 20 def branch(server, to = nil) @to = to || @to send_to_one(server, :change_branch, to: @to) end |
#pre_exec ⇒ Object
Prepare to execute the requested method
7 8 9 10 11 12 13 14 15 |
# File 'lib/client/controller/change.rb', line 7 def pre_exec OptionParser.new do |opt| opt. = "vermillion change [...-flags]" opt.on("-t", "--to=TO", "Branch to change to") { |o| @to = o } end.parse! super end |