Class: JsGenerator::ViewFile
- Inherits:
-
Object
- Object
- JsGenerator::ViewFile
- Defined in:
- lib/js_generator/view_file.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.
-
#setup_js ⇒ Object
readonly
Returns the value of attribute setup_js.
Instance Method Summary collapse
- #append_script ⇒ Object
-
#initialize(setup_js) ⇒ ViewFile
constructor
A new instance of ViewFile.
Constructor Details
#initialize(setup_js) ⇒ ViewFile
Returns a new instance of ViewFile.
5 6 7 8 9 10 |
# File 'lib/js_generator/view_file.rb', line 5 def initialize(setup_js) @namespace = setup_js.namespace @model_name = setup_js.model_name @action_name = setup_js.action_name @setup_js = setup_js end |
Instance Attribute Details
#action_name ⇒ Object (readonly)
Returns the value of attribute action_name.
3 4 5 |
# File 'lib/js_generator/view_file.rb', line 3 def action_name @action_name end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
3 4 5 |
# File 'lib/js_generator/view_file.rb', line 3 def model_name @model_name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
3 4 5 |
# File 'lib/js_generator/view_file.rb', line 3 def namespace @namespace end |
#setup_js ⇒ Object (readonly)
Returns the value of attribute setup_js.
3 4 5 |
# File 'lib/js_generator/view_file.rb', line 3 def setup_js @setup_js end |
Instance Method Details
#append_script ⇒ Object
12 13 14 |
# File 'lib/js_generator/view_file.rb', line 12 def append_script File.open(file_path, 'a') { |f| f << script_tag } end |