Class: Teepee::NumberToken

Inherits:
Token show all
Defined in:
lib/teepee/number-token.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ParserNode

#use_scope

Constructor Details

#initialize(text) ⇒ NumberToken

Returns a new instance of NumberToken.

Raises:

  • (ArgumentError)


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

#numberObject (readonly)

Returns the value of attribute number.



45
46
47
# File 'lib/teepee/number-token.rb', line 45

def number
  @number
end

#textObject (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

Returns:

  • (Boolean)


64
65
# File 'lib/teepee/number-token.rb', line 64

def matches? text
end

Instance Method Details

#parseObject



52
53
# File 'lib/teepee/number-token.rb', line 52

def parse
end

#to_htmlObject



59
60
61
# File 'lib/teepee/number-token.rb', line 59

def to_html
  to_s
end

#to_sObject



55
56
57
# File 'lib/teepee/number-token.rb', line 55

def to_s
  number.to_s
end