Commit aec51d37 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Change return value type of Tag#process_doc.

Instead of returning a single value, a hash must be returned which will
get merged with the resulting class/member hash.

The advantage being that one @tag can generate multiple fields in the
final class/member hash.
parent ebd63074
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ module JsDuck
      def add_shared(hash, doc_map)
        doc_map.each_pair do |key, value|
          if tag = TagRegistry.get_by_key(key)
            hash[key] = tag.process_doc(value)
            hash.merge!(tag.process_doc(value))
          end
        end

+1 −1
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ module JsDuck::Tag
    end

    def process_doc(tags)
      tags.map {|tag| tag[:name] }
      {:aliases => tags.map {|tag| tag[:name] }}
    end

    def parse_ext_define(cls, ast)
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ module JsDuck::Tag
    end

    def process_doc(tags)
      tags
      {:aside => tags}
    end

    def to_html(context)
+1 −1
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ module JsDuck::Tag

    # When the tag is found, its value will always be true.
    def process_doc(docs)
      true
      {@key => true}
    end
  end
end
+2 −1
Original line number Diff line number Diff line
@@ -29,7 +29,8 @@ module JsDuck::Tag
    end

    def process_doc(tags)
      tags.map {|d| d[:classes] }.flatten
      list = tags.map {|d| d[:classes] }.flatten
      return {@key => list}
    end

    def parse_ext_define(cls, ast)
Loading