Class: JsGenerator::AppJs
- Inherits:
-
Object
- Object
- JsGenerator::AppJs
- Defined in:
- lib/js_generator/app_js.rb
Instance Attribute Summary collapse
-
#syntax_builder ⇒ Object
readonly
Returns the value of attribute syntax_builder.
Instance Method Summary collapse
- #append_script ⇒ Object
-
#initialize(syntax_builder) ⇒ AppJs
constructor
A new instance of AppJs.
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_builder ⇒ Object (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_script ⇒ Object
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 |