Class: Twat::Subcommands::Delete
- Inherits:
-
Base
- Object
- Base
- Twat::Subcommands::Delete
show all
- Defined in:
- lib/twat/subcommands/delete.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#args, #auth!, #beep, #config, #deentitize, #enable_readline!, #format, #initialize, #needs_arguments, #needs_at_least, #opts, #pad, #reader, #run!, #usage, #usage_and_exit!
Methods included from Exceptions
#with_handled_exceptions
Class Method Details
.usage ⇒ Object
14
15
16
|
# File 'lib/twat/subcommands/delete.rb', line 14
def self.usage
"Usage: twat delete ACCOUNTNAME"
end
|
Instance Method Details
#run ⇒ Object
4
5
6
7
8
9
10
11
12
|
# File 'lib/twat/subcommands/delete.rb', line 4
def run
needs_arguments(1)
if config.accounts.delete(@argv[0])
config.save!
puts "Successfully deleted"
else
puts "No such account"
end
end
|
#updateconfig ⇒ Object
18
19
20
|
# File 'lib/twat/subcommands/delete.rb', line 18
def updateconfig
config.update!
end
|