Method: Object#json_data_type
- Defined in:
- lib/watchdocs/rails/core_extensions/object.rb
#json_data_type ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/watchdocs/rails/core_extensions/object.rb', line 2 def json_data_type if is_a?(Numeric) 'number' elsif is_a?(NilClass) 'null' elsif is_a?(String) 'string' elsif is_a?(TrueClass) || is_a?(FalseClass) 'boolean' else '*****' end end |