Class: Class

Inherits:
Object
  • Object
show all
Defined in:
lib/firm/serializer/json.rb

Instance Method Summary collapse

Instance Method Details

#json_creatable?Boolean

override this to be able to do safe deserializing

Returns:

  • (Boolean)


331
332
333
334
335
336
337
338
# File 'lib/firm/serializer/json.rb', line 331

def json_creatable?
  if FIRM::Serializable::JSON.safe_parsing?
    return false unless FIRM::Serializable::JSON.serializables.include?(self) ||
                        FIRM::Serializable.serializables.include?(self) ||
                        ::Struct > self
  end
  respond_to?(:json_create)
end