Class: JsGenerator::AppJs

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(syntax_builder) ⇒ AppJs

Returns a new instance of AppJs.



10
11
12
# File 'lib/js_generator/app_js.rb', line 10

def initialize(syntax_builder)
  @syntax_builder = syntax_builder
end

Instance Attribute Details

#syntax_builderObject (readonly)

Returns the value of attribute syntax_builder.



8
9
10
# File 'lib/js_generator/app_js.rb', line 8

def syntax_builder
  @syntax_builder
end

Instance Method Details

#append_scriptObject



14
15
16
17
18
19
20
# File 'lib/js_generator/app_js.rb', line 14

def append_script
  File.open(file_path, 'a') do |f|
    f << syntax_builder.script_for_append
  end

  puts "📝️ Appended script to #{file_path}"
end