nitc :: CatalogStats
nitc :: CatalogStats :: contributors=
Number of contributorsnitc :: CatalogStats :: defaultinit
nitc :: CatalogStats :: maintainers=
Number of maintainersnitc $ CatalogStats :: SELF
Type of this instance, automatically specialized in every classnitc :: json_model $ CatalogStats :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: json_model $ CatalogStats :: from_deserializer
Create an instance of this class from thedeserializer
serialization :: Serializable :: accept_inspect_serializer_core
serialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: CatalogStats :: contributors=
Number of contributorsserialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
nitc :: CatalogStats :: defaultinit
core :: Object :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: CatalogStats :: maintainers=
Number of maintainersserialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: serialize_to_or_delay
Accept references or force direct serialization (usingserialize_to
)
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
Serializer::serialize
# Catalog statistics
class CatalogStats
# Number of packages
var packages = 0
# Number of maintainers
var maintainers = 0
# Number of contributors
var contributors = 0
# Number of tags
var tags = 0
# Number of modules
var modules = 0
# Number of classes
var classes = 0
# Number of methods
var methods = 0
# Number of line of codes
var loc = 0
# Return the stats as a Map associating each stat key to its value
fun to_map: Map[String, Int] do
var map = new HashMap[String, Int]
map["packages"] = packages
map["maintainers"] = maintainers
map["contributors"] = contributors
map["tags"] = tags
map["modules"] = modules
map["classes"] = classes
map["methods"] = methods
map["loc"] = loc
return map
end
end
src/catalog/catalog.nit:545,1--585,3
# Catalog statistics
redef class CatalogStats
serialize
redef fun core_serialize_to(v) do
super
v.serialize_attribute("packages", packages)
v.serialize_attribute("maintainers", maintainers)
v.serialize_attribute("contributors", contributors)
v.serialize_attribute("tags", tags)
v.serialize_attribute("modules", modules)
v.serialize_attribute("classes", classes)
v.serialize_attribute("methods", methods)
v.serialize_attribute("loc", loc)
end
end
src/doc/templates/json_model.nit:402,1--417,3