Class: HamlParser::Ast::Script

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

#initializeScript

Returns a new instance of Script.



75
76
77
78
79
80
81
82
83
# File 'lib/haml_parser/ast.rb', line 75

def initialize(*)
  super
  if escape_html.nil?
    self.escape_html = true
  end
  if preserve.nil?
    self.preserve = false
  end
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children

Returns:

  • (Object)

    the current value of children



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def children
  @children
end

#escape_htmlObject

Returns the value of attribute escape_html

Returns:

  • (Object)

    the current value of escape_html



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def escape_html
  @escape_html
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def filename
  @filename
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def lineno
  @lineno
end

#preserveObject

Returns the value of attribute preserve

Returns:

  • (Object)

    the current value of preserve



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def preserve
  @preserve
end

#scriptObject

Returns the value of attribute script

Returns:

  • (Object)

    the current value of script



65
66
67
# File 'lib/haml_parser/ast.rb', line 65

def script
  @script
end

Instance Method Details

#to_hObject



85
86
87
# File 'lib/haml_parser/ast.rb', line 85

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