Class: Neo4j::TypeConverters::NilClassConverter

Inherits:
Object
  • Object
show all
Defined in:
lib/devise/orm/neo4j/nil_class_converter.rb

Class Method Summary collapse

Class Method Details

.convert?(type) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/devise/orm/neo4j/nil_class_converter.rb', line 4

def convert?(type)
  type == NilClass || type == :nilclass
end

.index_asObject



20
21
22
# File 'lib/devise/orm/neo4j/nil_class_converter.rb', line 20

def index_as
  String
end

.to_java(val) ⇒ Object



8
9
10
11
12
# File 'lib/devise/orm/neo4j/nil_class_converter.rb', line 8

def to_java(val)
  return nil if val.nil?
  return nil if val.empty?
  val
end

.to_ruby(val) ⇒ Object



14
15
16
17
18
# File 'lib/devise/orm/neo4j/nil_class_converter.rb', line 14

def to_ruby(val)
  return nil if val.nil?
  return nil if val.empty?
  val
end