Class: HamlParser::ScriptParser
- Inherits:
-
Object
- Object
- HamlParser::ScriptParser
- Defined in:
- lib/haml_parser/script_parser.rb
Instance Method Summary collapse
-
#initialize(line_parser) ⇒ ScriptParser
constructor
A new instance of ScriptParser.
- #parse(text) ⇒ Object
Constructor Details
#initialize(line_parser) ⇒ ScriptParser
Returns a new instance of ScriptParser.
7 8 9 |
# File 'lib/haml_parser/script_parser.rb', line 7 def initialize(line_parser) @line_parser = line_parser end |
Instance Method Details
#parse(text) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/haml_parser/script_parser.rb', line 11 def parse(text) case text[0] when '=', '~' parse_script(text) when '&' parse_sanitized(text) when '!' parse_unescape(text) else parse_text(text) end end |