Class: CSVConverter::Converters::IntegerConverter
- Inherits:
-
BaseConverter
- Object
- BaseConverter
- CSVConverter::Converters::IntegerConverter
- Defined in:
- lib/csv_converter/converters/integer_converter.rb
Overview
Converts a string into an integer
Instance Attribute Summary
Attributes inherited from BaseConverter
Instance Method Summary collapse
-
#call ⇒ Integer
Converts data into an Integer.
-
#call! ⇒ Integer
Converts data into an Integer.
Methods inherited from BaseConverter
#data, #empty_value?, #initialize
Constructor Details
This class inherits a constructor from CSVConverter::Converters::BaseConverter
Instance Method Details
#call ⇒ Integer
Converts data into an Integer.
9 10 11 12 13 |
# File 'lib/csv_converter/converters/integer_converter.rb', line 9 def call call! rescue CSVConverter::Error nullable_object end |
#call! ⇒ Integer
Converts data into an Integer.
17 18 19 20 21 |
# File 'lib/csv_converter/converters/integer_converter.rb', line 17 def call! Integer(data) rescue StandardError => e raise CSVConverter::Error.new(e., ) end |