Loading lib/jsduck/merger.rb +1 −3 Original line number Diff line number Diff line Loading @@ -35,9 +35,7 @@ module JsDuck # Applies processing to extract fields relevant to the member type. def process_code(tagname, code) result = {} TagRegistry.get_by_name(tagname).process_code(result, code) result TagRegistry.get_by_name(tagname).process_code(code) end # Invokes the #merge methods of tags registered for the given Loading lib/jsduck/tag/cfg.rb +3 −2 Original line number Diff line number Diff line Loading @@ -47,12 +47,13 @@ module JsDuck::Tag h[:name] = nested[:name] end def process_code(h, code) super(h, code) def process_code(code) h = super(code) h[:type] = code[:type] h[:default] = code[:default] h[:accessor] = code[:accessor] h[:evented] = code[:evented] h end def to_html(cfg, cls) Loading lib/jsduck/tag/class.rb +3 −3 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ module JsDuck::Tag # # If we did detect code as a class use all the auto-detected # fields, otherwise use only the name field. def process_code(h, code) def process_code(code) if code[:tagname] == :class h.merge!(code) code else h[:name] = code[:name] {:name => code[:name] } end end Loading lib/jsduck/tag/css_var.rb +3 −2 Original line number Diff line number Diff line Loading @@ -27,10 +27,11 @@ module JsDuck::Tag h[:default] = p[:default] end def process_code(h, code) super(h, code) def process_code(code) h = super(code) h[:type] = code[:type] h[:default] = code[:default] h end def to_html(var, cls) Loading lib/jsduck/tag/member_tag.rb +19 −16 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ module JsDuck::Tag MEMBER_POS_CSS_MIXIN = 6 # Extracts the fields auto-detected from code that are relevant to # the member type and saves them to the context hash. # the member type and returns a hash with them. # # The implementation here extracts fields applicable to all member # types. When additional member-specific fields are to be Loading @@ -67,24 +67,27 @@ module JsDuck::Tag # For example inside Method tag we might additionally want to # extract :type and :default: # # def process_code(context, code) # super(context, code) # context[:type] = code[:type] # context[:default] = code[:default] # def process_code(code) # h = super(code) # h[:type] = code[:type] # h[:default] = code[:default] # h # end # def process_code(context, code) context[:tagname] = code[:tagname] def process_code(code) return { :tagname => code[:tagname], # An auto-detected name might be "MyClass.prototype.myMethod" - # for member name we only want the last "myMethod" part. context[:name] = code[:name] ? code[:name].split(/\./).last : nil :name => code[:name] ? code[:name].split(/\./).last : nil, context[:autodetected] = code[:autodetected] context[:inheritdoc] = code[:inheritdoc] context[:static] = code[:static] context[:private] = code[:private] context[:inheritable] = code[:inheritable] context[:linenr] = code[:linenr] :autodetected => code[:autodetected], :inheritdoc => code[:inheritdoc], :static => code[:static], :private => code[:private], :inheritable => code[:inheritable], :linenr => code[:linenr], } end # This method defines the signature-line of the member. Loading Loading
lib/jsduck/merger.rb +1 −3 Original line number Diff line number Diff line Loading @@ -35,9 +35,7 @@ module JsDuck # Applies processing to extract fields relevant to the member type. def process_code(tagname, code) result = {} TagRegistry.get_by_name(tagname).process_code(result, code) result TagRegistry.get_by_name(tagname).process_code(code) end # Invokes the #merge methods of tags registered for the given Loading
lib/jsduck/tag/cfg.rb +3 −2 Original line number Diff line number Diff line Loading @@ -47,12 +47,13 @@ module JsDuck::Tag h[:name] = nested[:name] end def process_code(h, code) super(h, code) def process_code(code) h = super(code) h[:type] = code[:type] h[:default] = code[:default] h[:accessor] = code[:accessor] h[:evented] = code[:evented] h end def to_html(cfg, cls) Loading
lib/jsduck/tag/class.rb +3 −3 Original line number Diff line number Diff line Loading @@ -25,11 +25,11 @@ module JsDuck::Tag # # If we did detect code as a class use all the auto-detected # fields, otherwise use only the name field. def process_code(h, code) def process_code(code) if code[:tagname] == :class h.merge!(code) code else h[:name] = code[:name] {:name => code[:name] } end end Loading
lib/jsduck/tag/css_var.rb +3 −2 Original line number Diff line number Diff line Loading @@ -27,10 +27,11 @@ module JsDuck::Tag h[:default] = p[:default] end def process_code(h, code) super(h, code) def process_code(code) h = super(code) h[:type] = code[:type] h[:default] = code[:default] h end def to_html(var, cls) Loading
lib/jsduck/tag/member_tag.rb +19 −16 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ module JsDuck::Tag MEMBER_POS_CSS_MIXIN = 6 # Extracts the fields auto-detected from code that are relevant to # the member type and saves them to the context hash. # the member type and returns a hash with them. # # The implementation here extracts fields applicable to all member # types. When additional member-specific fields are to be Loading @@ -67,24 +67,27 @@ module JsDuck::Tag # For example inside Method tag we might additionally want to # extract :type and :default: # # def process_code(context, code) # super(context, code) # context[:type] = code[:type] # context[:default] = code[:default] # def process_code(code) # h = super(code) # h[:type] = code[:type] # h[:default] = code[:default] # h # end # def process_code(context, code) context[:tagname] = code[:tagname] def process_code(code) return { :tagname => code[:tagname], # An auto-detected name might be "MyClass.prototype.myMethod" - # for member name we only want the last "myMethod" part. context[:name] = code[:name] ? code[:name].split(/\./).last : nil :name => code[:name] ? code[:name].split(/\./).last : nil, context[:autodetected] = code[:autodetected] context[:inheritdoc] = code[:inheritdoc] context[:static] = code[:static] context[:private] = code[:private] context[:inheritable] = code[:inheritable] context[:linenr] = code[:linenr] :autodetected => code[:autodetected], :inheritdoc => code[:inheritdoc], :static => code[:static], :private => code[:private], :inheritable => code[:inheritable], :linenr => code[:linenr], } end # This method defines the signature-line of the member. Loading