Class: HamlParser::Ast::HtmlComment

Inherits:
Struct
  • Object
show all
Includes:
HasChildren
Defined in:
lib/haml_parser/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasChildren

#<<

Constructor Details

#initializeHtmlComment

Returns a new instance of HtmlComment.



108
109
110
111
112
# File 'lib/haml_parser/ast.rb', line 108

def initialize(*)
  super
  self.comment ||= ''
  self.conditional ||= ''
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



105
106
107
# File 'lib/haml_parser/ast.rb', line 105

def children
  @children
end

#commentObject

Returns the value of attribute comment

Returns:

  • (Object)

    the current value of comment



105
106
107
# File 'lib/haml_parser/ast.rb', line 105

def comment
  @comment
end

#conditionalObject

Returns the value of attribute conditional

Returns:

  • (Object)

    the current value of conditional



105
106
107
# File 'lib/haml_parser/ast.rb', line 105

def conditional
  @conditional
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



105
106
107
# File 'lib/haml_parser/ast.rb', line 105

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



105
106
107
# File 'lib/haml_parser/ast.rb', line 105

def lineno
  @lineno
end

Instance Method Details

#to_hObject



114
115
116
# File 'lib/haml_parser/ast.rb', line 114

def to_h
  super.merge(type: 'html_comment')
end