Class: NumberMuncher::Token::Int
- Inherits:
-
Base
- Object
- Base
- NumberMuncher::Token::Int
show all
- Defined in:
- lib/number_muncher/token/int.rb
Instance Attribute Summary
Attributes inherited from Base
#value
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#==, captures, #float?, #fraction?, #initialize, #inspect, scan, #to_a
Class Method Details
.regex ⇒ Object
4
5
6
|
# File 'lib/number_muncher/token/int.rb', line 4
def self.regex
/-?(\d{1,3}(#{Regexp.quote(NumberMuncher.thousands_separator)}\d{3})+|\d+)/
end
|
Instance Method Details
#int? ⇒ Boolean
12
13
14
|
# File 'lib/number_muncher/token/int.rb', line 12
def int?
true
end
|
#text ⇒ Object
8
9
10
|
# File 'lib/number_muncher/token/int.rb', line 8
def text
super.delete(NumberMuncher.thousands_separator)
end
|