Sha256: 3e84258bc7f329f1f3984c13079909f8ff055ffa8b02413a3f6dae96ecbf2751

Contents?: true

Size: 873 Bytes

Versions: 8

Compression:

Stored size: 873 Bytes

Contents

require "jsduck/tag/tag"
require "jsduck/tag/boolean_tag"

# See https://github.com/senchalabs/jsduck/wiki/Custom-tags

module JsDuck::Tag
  # Introduce "handler" as a separate class member.
  class Handler < MemberTag
    def initialize
      @pattern = "handler"
      @tagname = :handler
      @member_type = {
          :title => "Handlers",
          :position => MEMBER_POS_METHOD + 0.1,
          :icon => File.dirname(__FILE__) + "/icons/handler.png"
      }
    end

    # @event name ...
    def parse_doc(p, pos)
      {
          :tagname => :handler,
          :name => p.ident,
      }
    end

    def process_doc(h, tags, pos)
      h[:name] = tags[0][:name]
    end

    def merge(h, docs, code)
      JsDuck::ParamsMerger.merge(h, docs, code)
    end

    def to_html(event, cls)
      member_link(event) + member_params(event[:params])
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
jsduck-troopjs-0.0.10 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.9 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.8 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.7 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.5 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.4 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.3 lib/jsduck/tag/handler.rb
jsduck-troopjs-0.0.1 lib/jsduck/tag/handler.rb