Class: TBMX::SingleCharacterToken
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.character_matched ⇒ Object
69
70
71
|
# File 'lib/tbmx.rb', line 69
def character_matched
self::CHARACTER_MATCHED
end
|
.matches?(text) ⇒ Boolean
73
74
75
76
77
78
79
|
# File 'lib/tbmx.rb', line 73
def matches? text
if text.first == character_matched
return [self.new, text.rest]
else
return nil
end
end
|
Instance Method Details
#text ⇒ Object
64
65
66
|
# File 'lib/tbmx.rb', line 64
def text
self.class.character_matched
end
|