Class: Cue::Command::Toggle
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(args) ⇒ Toggle
constructor
A new instance of Toggle.
- #nargs ⇒ Object
Methods inherited from Base
#find_item, #find_key, #parser
Constructor Details
#initialize(args) ⇒ Toggle
Returns a new instance of Toggle.
6 7 8 9 |
# File 'lib/cue/command/toggle.rb', line 6 def initialize(args) super(args) @sha = @args.first end |
Instance Method Details
#execute ⇒ Object
11 12 13 14 15 16 |
# File 'lib/cue/command/toggle.rb', line 11 def execute find_item(@sha).tap do |item| item.toggle! item.save(.store) end end |
#nargs ⇒ Object
18 19 20 |
# File 'lib/cue/command/toggle.rb', line 18 def nargs 1 end |