Class: Haml2Erb::Tokens::Token
- Inherits:
-
Object
- Object
- Haml2Erb::Tokens::Token
- Defined in:
- lib/haml2erb/tokens.rb
Direct Known Subclasses
AttributesEnd, AttributesStart, Contents, ContentsStart, Indent, InitialAttribute, InnerAttributeNumber, InnerAttributeQuoted, InnerAttributeRuby
Instance Attribute Summary collapse
-
#matched ⇒ Object
readonly
Returns the value of attribute matched.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(matched, options = {}) ⇒ Token
constructor
A new instance of Token.
Constructor Details
#initialize(matched, options = {}) ⇒ Token
Returns a new instance of Token.
7 8 9 10 |
# File 'lib/haml2erb/tokens.rb', line 7 def initialize(matched, = {}) @matched = matched @options = end |
Instance Attribute Details
#matched ⇒ Object (readonly)
Returns the value of attribute matched.
5 6 7 |
# File 'lib/haml2erb/tokens.rb', line 5 def matched @matched end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/haml2erb/tokens.rb', line 5 def @options end |
Class Method Details
.match(text) ⇒ Object
12 13 14 15 |
# File 'lib/haml2erb/tokens.rb', line 12 def self.match(text) match_data = @regex.match(text) match_data ? self.new(match_data.to_s) : nil end |