Sha256: c197d851e5479b8b1c2047f8ef1718ad4fcb21eb8657ae8bd1ab937a142fd05b

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

$_doc = []


class Module

  attr :docs

  # The idea here is to have dynamic docs.
  #
  #   doc "X does such and such"
  #   doc "it is very powerful"
  #   class X
  #     doc "f does such and such"
  #     doc "it is where the power lies"
  #     def f
  #       ...
  #     end
  #   end
  #
  # One of the great things about doc, is that
  # it can be used to "inherit" documentation.

  def doc(str)
    $_doc << string
  end

  def method_added(meth)
    @docs ||= {}
    @docs[self, meth] << $_doc
    $_doc.clear
    nil
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
quarry-0.3.0 lib/quarry/document.rb
quarry-0.4.0 work/consider/document.rb