Class: Teepee::NumberToken
- Inherits:
-
Token
- Object
- ParserNode
- Token
- Teepee::NumberToken
- Defined in:
- lib/teepee/number-token.rb
Instance Attribute Summary collapse
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text) ⇒ NumberToken
constructor
A new instance of NumberToken.
- #parse ⇒ Object
- #to_html ⇒ Object
- #to_s ⇒ Object
Methods inherited from ParserNode
Constructor Details
#initialize(text) ⇒ NumberToken
Returns a new instance of NumberToken.
47 48 49 50 |
# File 'lib/teepee/number-token.rb', line 47 def initialize(text) raise ArgumentError if not text.is_a? String @text = text end |
Instance Attribute Details
#number ⇒ Object (readonly)
Returns the value of attribute number.
45 46 47 |
# File 'lib/teepee/number-token.rb', line 45 def number @number end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
45 46 47 |
# File 'lib/teepee/number-token.rb', line 45 def text @text end |
Class Method Details
.matches?(text) ⇒ Boolean
64 65 |
# File 'lib/teepee/number-token.rb', line 64 def matches? text end |
Instance Method Details
#parse ⇒ Object
52 53 |
# File 'lib/teepee/number-token.rb', line 52 def parse end |
#to_html ⇒ Object
59 60 61 |
# File 'lib/teepee/number-token.rb', line 59 def to_html to_s end |
#to_s ⇒ Object
55 56 57 |
# File 'lib/teepee/number-token.rb', line 55 def to_s number.to_s end |