Class: EJX::Template::HTMLComment
- Inherits:
-
Object
- Object
- EJX::Template::HTMLComment
- Defined in:
- lib/ejx/template/html_comment.rb
Instance Method Summary collapse
-
#initialize(comment) ⇒ HTMLComment
constructor
A new instance of HTMLComment.
- #inspect ⇒ Object
- #to_js(append: "__output", var_generator:, indentation: 4, namespace: nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(comment) ⇒ HTMLComment
Returns a new instance of HTMLComment.
3 4 5 |
# File 'lib/ejx/template/html_comment.rb', line 3 def initialize(comment) @comment = comment end |
Instance Method Details
#inspect ⇒ Object
11 12 13 |
# File 'lib/ejx/template/html_comment.rb', line 11 def inspect "#<EJX::HTMLComment:#{self.object_id} @comment=#{@comment}>" end |
#to_js(append: "__output", var_generator:, indentation: 4, namespace: nil) ⇒ Object
15 16 17 |
# File 'lib/ejx/template/html_comment.rb', line 15 def to_js(append: "__output", var_generator:, indentation: 4, namespace: nil) "#{' '*indentation}#{append}.push(document.createComment(#{JSON.generate(@comment)}));\n" end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/ejx/template/html_comment.rb', line 7 def to_s @comment end |