Class: JsGenerator::AppJs
- Inherits:
-
Object
- Object
- JsGenerator::AppJs
- Defined in:
- lib/js_generator/app_js.rb
Instance Attribute Summary collapse
-
#action_name ⇒ Object
readonly
Returns the value of attribute action_name.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#top_level_js_namespace ⇒ Object
readonly
Returns the value of attribute top_level_js_namespace.
Instance Method Summary collapse
- #action_namespace ⇒ Object
- #append_script ⇒ Object
-
#initialize(setup_js) ⇒ AppJs
constructor
A new instance of AppJs.
Constructor Details
#initialize(setup_js) ⇒ AppJs
Returns a new instance of AppJs.
10 11 12 13 14 15 |
# File 'lib/js_generator/app_js.rb', line 10 def initialize(setup_js) @namespace = setup_js.namespace @model_name = setup_js.model_name @action_name = setup_js.action_name @top_level_js_namespace = setup_js.top_level_js_namespace end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
8 9 10 |
# File 'lib/js_generator/app_js.rb', line 8 def action_name @action_name end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
8 9 10 |
# File 'lib/js_generator/app_js.rb', line 8 def model_name @model_name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
8 9 10 |
# File 'lib/js_generator/app_js.rb', line 8 def namespace @namespace end |
#top_level_js_namespace ⇒ Object (readonly)
Returns the value of attribute top_level_js_namespace.
8 9 10 |
# File 'lib/js_generator/app_js.rb', line 8 def top_level_js_namespace @top_level_js_namespace end |
Instance Method Details
#action_namespace ⇒ Object
23 24 25 |
# File 'lib/js_generator/app_js.rb', line 23 def action_namespace syntax_builder.action_namespace end |
#append_script ⇒ Object
17 18 19 20 21 |
# File 'lib/js_generator/app_js.rb', line 17 def append_script File.open("app/javascript/packs/application.js", 'a') do |f| f << syntax_builder.script_for_append end end |