class Neo4j::Shared::TypeConverters::BooleanConverter

Constants

FALSE_VALUES

Public Class Methods

convert_type()
Alias for: db_type
converted?(value) click to toggle source
    # File lib/neo4j/shared/type_converters.rb
110 def converted?(value)
111   converted_values.include?(value)
112 end
converted_values() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
114 def converted_values
115   [true, false]
116 end
db_type() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
118 def db_type
119   Neo4j::Shared::Boolean
120 end
Also aliased as: convert_type
to_db(value) click to toggle source
    # File lib/neo4j/shared/type_converters.rb
124 def to_db(value)
125   return false if FALSE_VALUES.include?(value)
126   case value
127   when TrueClass, FalseClass
128     value
129   when Numeric, /^\-?[0-9]/
130     !value.to_f.zero?
131   else
132     value.present?
133   end
134 end
Also aliased as: to_ruby
to_ruby(value)
Alias for: to_db