Class: Cue::Command::Delete

Inherits:
Base
  • Object
show all
Defined in:
lib/cue/command/delete.rb

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#find_item, #find_key, #parser

Constructor Details

#initialize(args) ⇒ Delete

Returns a new instance of Delete.



6
7
8
9
# File 'lib/cue/command/delete.rb', line 6

def initialize(args)
  super(args)
  @sha = @args.first
end

Instance Method Details

#executeObject



11
12
13
14
# File 'lib/cue/command/delete.rb', line 11

def execute
  item_key = find_key(@sha)
  options.store.delete(item_key)
end

#nargsObject



16
17
18
# File 'lib/cue/command/delete.rb', line 16

def nargs
  1
end