Sha256: 203e5f2d5360de1e78f7e12f2bd7cda86fb8171af25cf4b9fc9a22f22d034fe6
Contents?: true
Size: 697 Bytes
Versions: 7
Compression:
Stored size: 697 Bytes
Contents
module Dox module DSL module Syntax extend ActiveSupport::Concern def document(subject, &block) documentation = _subjects[subject] = Documentation.new(subject: subject) documentation.instance_eval(&block) end def const_missing(name) documentation = _subjects[infer_subject(name)] return super unless documentation Module.new do define_singleton_method :included do |base| base.metadata.merge! documentation.config end end end def infer_subject(name) name.to_s.underscore.to_sym end def _subjects @_subjects ||= {} end end end end
Version data entries
7 entries across 7 versions & 1 rubygems