Class: TBMX::NumberToken

Inherits:
Token show all
Defined in:
lib/tbmx.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ NumberToken

Returns a new instance of NumberToken.

Raises:

  • (ArgumentError)


200
201
202
203
# File 'lib/tbmx.rb', line 200

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.



198
199
200
# File 'lib/tbmx.rb', line 198

def number
  @number
end

#textObject (readonly)

Returns the value of attribute text.



198
199
200
# File 'lib/tbmx.rb', line 198

def text
  @text
end

Class Method Details

.matches?(text) ⇒ Boolean

Returns:

  • (Boolean)


217
218
# File 'lib/tbmx.rb', line 217

def matches? text
end

Instance Method Details

#parseObject



205
206
# File 'lib/tbmx.rb', line 205

def parse
end

#to_htmlObject



212
213
214
# File 'lib/tbmx.rb', line 212

def to_html
  to_s
end

#to_sObject



208
209
210
# File 'lib/tbmx.rb', line 208

def to_s
  number.to_s
end