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
107 def converted?(value)
108   converted_values.include?(value)
109 end
converted_values() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
111 def converted_values
112   [true, false]
113 end
db_type() click to toggle source
    # File lib/neo4j/shared/type_converters.rb
115 def db_type
116   Neo4j::Shared::Boolean
117 end
Also aliased as: convert_type
to_db(value) click to toggle source
    # File lib/neo4j/shared/type_converters.rb
121 def to_db(value)
122   return false if FALSE_VALUES.include?(value)
123   case value
124   when TrueClass, FalseClass
125     value
126   when Numeric, /^\-?[0-9]/
127     !value.to_f.zero?
128   else
129     value.present?
130   end
131 end
Also aliased as: to_ruby
to_ruby(value)
Alias for: to_db