Loading lib/jsduck/merger.rb +0 −10 Original line number Diff line number Diff line Loading @@ -41,8 +41,6 @@ module JsDuck :singleton => false, }) h[:enum] = merge_enum(docs, code) if docs[:enum] h[:members] = [] TagRegistry.mergers(:class).each do |tag| Loading Loading @@ -143,14 +141,6 @@ module JsDuck return docs[:name] == nil || docs[:name] == code[:name] end # Takes the :enum always from docs, but the :doc_only can come # from either code or docs. def merge_enum(docs, code) enum = docs[:enum] enum[:doc_only] = docs[:enum][:doc_only] || (code[:enum] && code[:enum][:doc_only]) enum end end end lib/jsduck/tag/enum.rb +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ module JsDuck::Tag def initialize @pattern = "enum" @key = :enum @merge_context = :class end # @enum {Type} [name=default] ... Loading @@ -26,5 +27,13 @@ module JsDuck::Tag } end # Takes the :enum always from docs, but the :doc_only can come # from either code or docs. def merge(h, docs, code) return unless docs[:enum] h[:enum] = docs[:enum] h[:enum][:doc_only] = docs[:enum][:doc_only] || (code[:enum] && code[:enum][:doc_only]) end end end Loading
lib/jsduck/merger.rb +0 −10 Original line number Diff line number Diff line Loading @@ -41,8 +41,6 @@ module JsDuck :singleton => false, }) h[:enum] = merge_enum(docs, code) if docs[:enum] h[:members] = [] TagRegistry.mergers(:class).each do |tag| Loading Loading @@ -143,14 +141,6 @@ module JsDuck return docs[:name] == nil || docs[:name] == code[:name] end # Takes the :enum always from docs, but the :doc_only can come # from either code or docs. def merge_enum(docs, code) enum = docs[:enum] enum[:doc_only] = docs[:enum][:doc_only] || (code[:enum] && code[:enum][:doc_only]) enum end end end
lib/jsduck/tag/enum.rb +9 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ module JsDuck::Tag def initialize @pattern = "enum" @key = :enum @merge_context = :class end # @enum {Type} [name=default] ... Loading @@ -26,5 +27,13 @@ module JsDuck::Tag } end # Takes the :enum always from docs, but the :doc_only can come # from either code or docs. def merge(h, docs, code) return unless docs[:enum] h[:enum] = docs[:enum] h[:enum][:doc_only] = docs[:enum][:doc_only] || (code[:enum] && code[:enum][:doc_only]) end end end