Class: Transer::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/transer/cli.rb

Instance Method Summary collapse

Instance Method Details

#dicObject



17
18
19
# File 'lib/transer/cli.rb', line 17

def dic
    usage()
end

#ej(*word) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/transer/cli.rb', line 27

def ej(*word)
    sentence = ""
    word.each do |w|
        sentence += "+" + w 
    end
    search(sentence, 'english', 'japanese', 'EJdict')
end

#je(word) ⇒ Object



22
23
24
# File 'lib/transer/cli.rb', line 22

def je(word)
    search(word, 'japanese', 'english', 'EdictJE')
end

#trans(*word) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/transer/cli.rb', line 38

def trans(*word)
    if options[:ej]
        sentence = options[:ej]
        word.each do |w|
            sentence += "+" + w  
        end
        trans_word(sentence, 'en', 'ja')
    elsif options[:je]
        trans_word(options[:je], 'ja', 'en')
    else
        usage()
    end
end