Class: Neo4j::TypeConverters::FloatConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/type_converters/type_converters.rb

Class Method Summary collapse

Class Method Details

.convert?(clazz_or_symbol) ⇒ Boolean

Returns:

  • (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_asObject



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?
  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.to_f
end