Class: Rri::RubyConverters::IntegerConverter
- Inherits:
-
Object
- Object
- Rri::RubyConverters::IntegerConverter
- Defined in:
- lib/rri/ruby_converters/integer_converter.rb
Overview
Converter for R Integers
Convert R integer to ruby Fixnum
Instance Method Summary collapse
-
#convert(rexp) ⇒ Array
Convert R object to ruby format.
Instance Method Details
#convert(rexp) ⇒ Array
Convert R object to ruby format
If the R object is an integer, converts it into a ruby Fixnum
18 19 20 21 22 23 24 |
# File 'lib/rri/ruby_converters/integer_converter.rb', line 18 def convert(rexp) if rexp.kind_of?(REXP) and rexp.isInteger and rexp.length == 1 [true, rexp.asInteger] else [false, nil] end end |