Class: Asker

Inherits:
Object
  • Object
show all
Defined in:
lib/asker.rb

Overview

This class does all the job

  • start

  • load_input_data

  • create_output_files, show_create_output_files

  • create_questions

  • show_final_results

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAsker

Initialize atributes



24
25
26
27
28
# File 'lib/asker.rb', line 24

def initialize
  @concepts_ai = []
  @concepts = []
  @codes = []
end

Class Method Details

.check(filepath) ⇒ Object

Checking input file syntax

Parameters:

  • filepath (String)


67
68
69
# File 'lib/asker.rb', line 67

def self.check(filepath)
  Checker.check(filepath)
end

.create_skeleton(dirpath) ⇒ Object

Create asker input demo files

Parameters:

  • dirpath (String)


74
75
76
# File 'lib/asker.rb', line 74

def self.create_skeleton(dirpath)
  Skeleton.create(dirpath)
end

Instance Method Details

#create_output_filesObject

Create output files

  • Gift

  • YAML

  • TXT Doc



58
59
60
61
62
# File 'lib/asker.rb', line 58

def create_output_files
  show_create_output_files
  create_questions
  ConceptDocExporter.new(@concepts).export
end

#load_input_data(args) ⇒ Object

Load input data

Parameters:

  • args (Hash)


42
43
44
45
46
47
48
49
50
51
# File 'lib/asker.rb', line 42

def load_input_data(args)
  ProjectLoader.load(args)
  Project.instance.open
  data = InputLoader.load(Project.instance.get(:inputdirs).split(','))
  @concepts = data[:concepts]
  @codes = data[:codes]
  Project.instance.verbose "\n[INFO] Loading data from Internet"
  @world = World.new(@concepts)
  ConceptScreenExporter.export_all(@concepts)
end

#start(args = {}) ⇒ Object

Start working

Parameters:

  • args (Hash) (defaults to: {})


33
34
35
36
37
# File 'lib/asker.rb', line 33

def start(args = {})
  load_input_data(args)
  create_output_files
  show_final_results
end