9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/liff_selector.rb', line 9
def self.run(argv)
case argv[0]
when 'show'
show
when 'same'
same
when 'upload'
raise ArgumentError, 'give _type_ _url_' if argv.length != 3
upload(type: argv[1], url: argv[2])
when 'clean'
clean
when 'delete'
raise ArgumentError, 'give _liff_id_' if argv.length != 2
delete(liff_id: argv[1])
when 'help'
help
when 'create'
raise ArgumentError, 'give _file_name_' if argv.length != 2
create(file_name: argv[1])
else
raise NotImplementedError, 'unknow command given'
end
end
|