simple_doc
simple_doc
Simple autodocumentation for Struct and Classes.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
simple_doc:
github: kostya/simple_doc
- Run
shards install
Usage
require "simple_doc"
class A
include SimpleDoc
property a : Int32
@[SimpleDoc::Field(comment: "comment")]
property b = "bla"
property c : Float64?
@[SimpleDoc::Field(ignore: true)]
property d : String?
def initialize
@a = 0
end
end
puts A.document_type.to_s
# {a: Int32, c: Float64?, b: String("bla")}
puts A.document_type.to_printable_root
# A:
# a: Int32
# c: Float64?
# b: String("bla") # comment
Repository
simple_doc
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- over 3 years ago
- December 5, 2018
License
MIT License
Links
Synced at
Thu, 07 Nov 2024 18:25:21 GMT
Languages