Class: Haml2Erb::Tokens::Contents

Inherits:
Token
  • Object
show all
Defined in:
lib/haml2erb/tokens.rb

Instance Attribute Summary

Attributes inherited from Token

#matched, #options

Class Method Summary collapse

Methods inherited from Token

#initialize

Constructor Details

This class inherits a constructor from Haml2Erb::Tokens::Token

Class Method Details

.match(text) ⇒ Object


56
57
58
59
60
# File 'lib/haml2erb/tokens.rb', line 56

def self.match(text)
  text.gsub!(/\\\-/, "-")
  match_data = @regex.match(text)
  match_data ? self.new(match_data.to_s) : nil
end