Class: Neo4j::TypeConverters::FloatConverter
- Inherits:
-
Object
- Object
- Neo4j::TypeConverters::FloatConverter
- Defined in:
- lib/neo4j/type_converters/type_converters.rb
Class Method Summary collapse
- .convert?(clazz_or_symbol) ⇒ Boolean
- .index_as ⇒ Object
- .to_java(value) ⇒ Object
- .to_ruby(value) ⇒ Object
Class Method Details
.convert?(clazz_or_symbol) ⇒ Boolean
162 163 164 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 162 def convert?(clazz_or_symbol) Float == clazz_or_symbol || :float == clazz_or_symbol end |
.index_as ⇒ Object
176 177 178 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 176 def index_as Float end |
.to_java(value) ⇒ Object
166 167 168 169 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 166 def to_java(value) return nil if value.nil? Array === value ? value.map(&:to_f) : value.to_f end |
.to_ruby(value) ⇒ Object
171 172 173 174 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 171 def to_ruby(value) return nil if value.nil? value end |