Class: Cure::Main
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#clean_dir, #read_file, #with_file, #with_temp_dir
#config, #create_config, #register_config
Constructor Details
#initialize ⇒ Main
Returns a new instance of Main.
52
53
54
55
|
# File 'lib/cure/main.rb', line 52
def initialize
@is_initialised = false
@coordinator = Coordinator.new
end
|
Instance Attribute Details
47
48
49
|
# File 'lib/cure/main.rb', line 47
def coordinator
@coordinator
end
|
#is_initialised ⇒ Boolean
50
51
52
|
# File 'lib/cure/main.rb', line 50
def is_initialised
@is_initialised
end
|
Class Method Details
.init_from_file(template_file_loc, csv_file_loc, output_dir) ⇒ Cure::Main
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/cure/main.rb', line 21
def self.init_from_file(template_file_loc, csv_file_loc, output_dir)
main = Main.new
template_hash = JSON.parse(main.read_file(template_file_loc))
template = Template.from_hash(template_hash)
main.setup(csv_file_loc, template, output_dir)
main
end
|
.init_from_hash(template_hash, csv_file_loc, output_dir) ⇒ Cure::Main
36
37
38
39
40
41
42
43
44
|
# File 'lib/cure/main.rb', line 36
def self.init_from_hash(template_hash, csv_file_loc, output_dir)
main = Main.new
template = Template.from_hash(template_hash)
main.setup(csv_file_loc, template, output_dir)
main
end
|
Instance Method Details
#run_export ⇒ Object
57
58
59
|
# File 'lib/cure/main.rb', line 57
def run_export
@coordinator.process
end
|
#setup(csv_file_location, template, output_dir) ⇒ Cure::Main
65
66
67
68
69
70
|
# File 'lib/cure/main.rb', line 65
def setup(csv_file_location, template, output_dir)
config = create_config(csv_file_location, template, output_dir)
register_config(config)
self
end
|