Class: EWorld::RouteWriter

Inherits:
BaseWriter show all
Defined in:
lib/writers/route_writer.rb

Constant Summary

Constants inherited from BaseWriter

BaseWriter::CLASS, BaseWriter::CLASS_LOWER, BaseWriter::IMPORTS, BaseWriter::PACKAGE

Class Method Summary collapse

Methods inherited from BaseWriter

get_java_path_for

Class Method Details

.write(project, files_to_write) ⇒ Object

Responsible for writing the routes.js file.

Returns:

  • void

Raises:

  • (RuntimeError)


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/writers/route_writer.rb', line 7

def self.write(project, files_to_write)

    raise RuntimeError, "Expected project type to be: #{Blufin::Projects::TYPE_QUASAR}, instead got: #{project[Blufin::Projects::TYPE]}" unless project[Blufin::Projects::TYPE] == Blufin::Projects::TYPE_QUASAR
    @generated   = []
    @overwritten = []

    begin

        files_to_write.each do |file|
            Blufin::Files::write_file(file, Blufin::Arrays::convert_string_to_line_array(get_blank_file_content))
            @generated << file
        end

    rescue => e

        Blufin::Terminal::print_exception(e)

    end

    return @generated, @overwritten

end