nya_serializable
Version, currently 0.2.314 versions
- 0.2.12latestMar 8, 2024
- 0.2.11not indexedMar 8, 2024
- 0.2.10not indexedMar 8, 2024
- 0.2.9not indexedMar 8, 2024
- 0.2.8not indexedMar 8, 2024
- 0.2.7not indexedMar 8, 2024
- 0.2.6not indexedMar 8, 2024
- 0.2.5not indexedMar 8, 2024
- 0.2.4not indexedMar 8, 2024
- 0.2.3not indexedMar 8, 2024
- 0.2.2-alphanot indexedMar 8, 2024
- 0.2.1-alphanot indexedMar 8, 2024
- 0.2.0-alphanot indexedMar 8, 2024
- 0.1.0-alphanot indexedMar 8, 2024
github.com/nya-engine/nya_serializable
No description declared in shard.yml.
Nothing has been indexed for 0.2.3 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
nya_serializable:
github: nya-engine/nya_serializable
version: ~> 0.2.3Then run:
shards installshard.yml
No shard.yml has been indexed for 0.2.3. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
nya_serializable
Serializable module for Nya Engine
Installation
Add this to your application's shard.yml:
dependencies:
nya_serializable:
github: nya-engine/nya_serializable
Usage
require "nya_serializable"
class Foo
include Nya::Serializable
property foo = Bar.new
property bar = ["foo", "foo bar"]
property fubar = "unn4m3d"
serializable foo : Bar, bar : Array(String)
attribute fubar : String
end
Then you can #serialize it to something like that
<Foo fubar="unn4m3d">
<foo>
<Bar>
...
</Bar>
</foo>
<bar>
<item>foo</item>
<item>foo bar</item>
</bar>
</Foo>
And deserialize that XML into structure above with Nya::Serializable.deserialize(Foo)
:warning: You can also alias type names with also_known_as "alias_name" and rename properties with @[Rename("name")] annotation (the latter works only with instance vars, defined either manually or with property macro)
Type name translation
Due to XML specifications, some complex names cannot be serialized as is, so some transformations are applied before.
- Last double colon (
::) is translated into single colon (:) - Other double colons are translated into underscores (
_) - Type vars list of a generic class starts with double period ('..')
- Names in type vars list are separated with single period ('.')
- Type vars list ends with hyphen ('-')
- Named args are not supported
Contributing
- Fork it ( https://github.com/nya-engine/nya_serializable/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- unn4m3d - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.2.3- Tagged
- Mar 8, 2024
- Commit
e228e65afcb6- Indexed
- not yet
Dependents
Repository
github.com/nya-engine/nya_serializable
Metadata
- Created
- Aug 18, 2026
- Updated
- Sep 26, 2026
- Synced
- Sep 26, 2026
- Versions
- 14