Class: Neo4j::TypeConverters::FixnumConverter
- Inherits:
-
Object
- Object
- Neo4j::TypeConverters::FixnumConverter
- Defined in:
- lib/neo4j/type_converters/type_converters.rb
Class Method Summary collapse
- .convert?(class_or_symbol) ⇒ Boolean
- .index_as ⇒ Object
- .to_java(value) ⇒ Object
- .to_ruby(value) ⇒ Object
Class Method Details
.convert?(class_or_symbol) ⇒ Boolean
138 139 140 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 138 def convert?(class_or_symbol) Fixnum == class_or_symbol || :fixnum == class_or_symbol || :numeric == class_or_symbol end |
.index_as ⇒ Object
152 153 154 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 152 def index_as Fixnum end |
.to_java(value) ⇒ Object
142 143 144 145 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 142 def to_java(value) return nil if value.nil? Array === value ? value.map(&:to_i) : value.to_i end |
.to_ruby(value) ⇒ Object
147 148 149 150 |
# File 'lib/neo4j/type_converters/type_converters.rb', line 147 def to_ruby(value) return nil if value.nil? value#.to_i end |