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)


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

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.



194
195
196
# File 'lib/tbmx.rb', line 194

def number
  @number
end

#textObject (readonly)

Returns the value of attribute text.



194
195
196
# File 'lib/tbmx.rb', line 194

def text
  @text
end

Class Method Details

.matches?(text) ⇒ Boolean

Returns:

  • (Boolean)


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

def matches? text
end

Instance Method Details

#parseObject



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

def parse
end

#to_htmlObject



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

def to_html
  to_s
end

#to_sObject



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

def to_s
  number.to_s
end