class Neo4j::Shared::TypeConverters::EnumConverter
Public Class Methods
new(enum_keys, options)
click to toggle source
# File lib/neo4j/shared/type_converters.rb 267 def initialize(enum_keys, options) 268 @enum_keys = enum_keys 269 @options = options 270 end
Public Instance Methods
convert_type()
click to toggle source
# File lib/neo4j/shared/type_converters.rb 284 def convert_type 285 Symbol 286 end
converted?(value)
click to toggle source
# File lib/neo4j/shared/type_converters.rb 272 def converted?(value) 273 value.is_a?(db_type) 274 end
db_type()
click to toggle source
# File lib/neo4j/shared/type_converters.rb 280 def db_type 281 Integer 282 end
supports_array?()
click to toggle source
# File lib/neo4j/shared/type_converters.rb 276 def supports_array? 277 true 278 end
to_db(value)
click to toggle source
# File lib/neo4j/shared/type_converters.rb 294 def to_db(value) 295 if value.is_a?(Array) 296 value.map(&method(:to_db)) 297 else 298 @enum_keys[value.to_s.to_sym] || 0 299 end 300 end
to_ruby(value)
click to toggle source
# File lib/neo4j/shared/type_converters.rb 288 def to_ruby(value) 289 @enum_keys.key(value) unless value.nil? 290 end
Also aliased as: call