Class: FastHaml::ScriptParser

Inherits:
Object
  • Object
show all
Defined in:
lib/fast_haml/script_parser.rb

Instance Method Summary collapse

Constructor Details

#initialize(line_parser) ⇒ ScriptParser

Returns a new instance of ScriptParser.



7
8
9
# File 'lib/fast_haml/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/fast_haml/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