Class: Csv2Psql::Analyzers::Bigint
- Inherits:
-
BaseAnalyzer
- Object
- BaseAnalyzer
- Csv2Psql::Analyzers::Bigint
- Defined in:
- lib/csv2psql/analyzer/types/bigint.rb
Overview
Bigint value matcher
Constant Summary collapse
- TYPE =
:bigint- CLASS =
:numeric- WEIGHT =
4- RE =
Regexp.new(/^\d+$/)
Class Method Summary collapse
Methods inherited from BaseAnalyzer
#analyze, #convert, #numeric?, numeric?, #sql_class, sql_class, sql_class?, #sql_class?, sql_type, #sql_type, sql_type?, #sql_type?, weight, #weight
Class Method Details
.analyze(val) ⇒ Object
16 17 18 |
# File 'lib/csv2psql/analyzer/types/bigint.rb', line 16 def analyze(val) val && RE.match(val) end |
.convert(val) ⇒ Object
20 21 22 |
# File 'lib/csv2psql/analyzer/types/bigint.rb', line 20 def convert(val) val.to_i end |