Class: Epodder::Remove

Inherits:
Verb show all
Defined in:
lib/verb/remove.rb

Instance Method Summary collapse

Methods inherited from Verb

#add_command, #each_argument, #lookup_args, #verb_struct

Constructor Details

#initializeRemove



4
5
6
# File 'lib/verb/remove.rb', line 4

def initialize

end

Instance Method Details

#remove(args) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/verb/remove.rb', line 8

def remove args
    each_argument(args) do |podcast|
        input = ask("Remove #{podcast.id} : #{podcast.title}? Type \"YES\" to remove")
        if input == "YES"
            podcast.destroy
        end
    end
    args.map{|id| Podcast.get(id)}.each do |podcast|
        input = ask("Remove #{podcast.id} : #{podcast.title}? Type \"YES\" to remove")
        if input == "YES"
            podcast.destroy
        end
    end
end