simple_doc

Simple autodocumentation for Struct and Classes.

simple_doc

Simple autodocumentation for Struct and Classes.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  simple_doc:
    github: kostya/simple_doc
  1. 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

Sun, 22 Dec 2024 03:46:00 GMT

Languages