module Dox::DSL::Syntax
Public Instance Methods
_subjects()
click to toggle source
# File lib/dox/dsl/syntax.rb, line 27 def _subjects @_subjects ||= {} end
const_missing(name)
click to toggle source
Calls superclass method
# File lib/dox/dsl/syntax.rb, line 11 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
document(subject, &block)
click to toggle source
# File lib/dox/dsl/syntax.rb, line 6 def document(subject, &block) documentation = _subjects[subject] = Documentation.new(subject: subject) documentation.instance_eval(&block) end
infer_subject(name)
click to toggle source
# File lib/dox/dsl/syntax.rb, line 23 def infer_subject(name) name.to_s.underscore.to_sym end