Class: HamdownCore::Ast::Script

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasChildren

#<<

Constructor Details

#initializeScript

Returns a new instance of Script.



92
93
94
95
96
97
98
99
100
# File 'lib/hamdown_core/ast.rb', line 92

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



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def children
  @children
end

#escape_htmlObject

Returns the value of attribute escape_html

Returns:

  • (Object)

    the current value of escape_html



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def escape_html
  @escape_html
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def filename
  @filename
end

#keywordObject

Returns the value of attribute keyword

Returns:

  • (Object)

    the current value of keyword



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def keyword
  @keyword
end

#linenoObject

Returns the value of attribute lineno

Returns:

  • (Object)

    the current value of lineno



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def lineno
  @lineno
end

#preserveObject

Returns the value of attribute preserve

Returns:

  • (Object)

    the current value of preserve



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def preserve
  @preserve
end

#scriptObject

Returns the value of attribute script

Returns:

  • (Object)

    the current value of script



81
82
83
# File 'lib/hamdown_core/ast.rb', line 81

def script
  @script
end

Instance Method Details

#to_hObject



102
103
104
# File 'lib/hamdown_core/ast.rb', line 102

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