Module: CodeAIFactory

Defined in:
lib/asker/code/ai/code_ai_factory.rb

Class Method Summary collapse

Class Method Details

.get(code) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/asker/code/ai/code_ai_factory.rb', line 8

def self.get(code)
  type = code.type
  case type
  when :javascript
    return JavascriptCodeAI.new(code)
  when :python
    return PythonCodeAI.new(code)
  when :ruby
    return RubyCodeAI.new(code)
  when :sql
    return SQLCodeAI.new(code)
  when :vagrantfile
    return RubyCodeAI.new(code)
  else
    puts "[ERROR] <#{type}> is not valid type"
  end
  nil
end