Loading lib/jsduck/builtins/hide.rb +5 −0 Original line number Diff line number Diff line Loading @@ -5,11 +5,16 @@ module JsDuck::Builtins class Hide < Tag def initialize @pattern = "hide" @key = :hide end # @hide def parse(p) p.add_tag(:hide) end def process_doc(docs) true end end end lib/jsduck/builtins/inheritable.rb +5 −0 Original line number Diff line number Diff line Loading @@ -4,11 +4,16 @@ module JsDuck::Builtins class Inheritable < Tag def initialize @pattern = "inheritable" @key = :inheritable end # @inheritable def parse(p) p.add_tag(:inheritable) end def process_doc(docs) true end end end lib/jsduck/builtins/tag.rb +10 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,16 @@ module JsDuck::Builtins def parse(p) end # Defines the symbol under which the tag data is stored in final # member/class hash. attr_reader :key # Gets called with array of @tag data that was generated by # #parse. The return value is stored under :key in the resulting # member/class hash. def process_doc(docs) end # Defines the name of object property in Ext.define() # configuration which, when encountered, will cause the # #parse_ext_define method to be invoked. Loading lib/jsduck/builtins_registry.rb +9 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module JsDuck @patterns = {} @ext_define_patterns = {} @ext_define_defaults = {} @keys = {} load_tag_classes(File.dirname(__FILE__) + "/builtins") instantiate_tags end Loading @@ -33,6 +34,9 @@ module JsDuck if tag.ext_define_default @ext_define_defaults.merge!(tag.ext_define_default) end if tag.key @keys[tag.key] = tag end end end Loading @@ -49,6 +53,11 @@ module JsDuck # Default values for class config when Ext.define is encountered. attr_reader :ext_define_defaults # Accesses tag by key name - the symbol under which the tag data # is stored in final hash. def get_by_key(key) @keys[key] end end end lib/jsduck/doc_ast.rb +6 −2 Original line number Diff line number Diff line Loading @@ -134,12 +134,16 @@ module JsDuck # Detects properties common for each doc-object and adds them def add_shared(hash, doc_map) hash.merge!({ :inheritable => !!doc_map[:inheritable], :hide => !!doc_map[:hide], :inheritdoc => extract(doc_map, :inheritdoc), :meta => detect_meta(doc_map), }) doc_map.each_pair do |key, value| if tag = BuiltinsRegistry.get_by_key(key) hash[key] = tag.process_doc(value) end end # copy :private also to main hash hash[:private] = hash[:meta][:private] ? true : nil Loading Loading
lib/jsduck/builtins/hide.rb +5 −0 Original line number Diff line number Diff line Loading @@ -5,11 +5,16 @@ module JsDuck::Builtins class Hide < Tag def initialize @pattern = "hide" @key = :hide end # @hide def parse(p) p.add_tag(:hide) end def process_doc(docs) true end end end
lib/jsduck/builtins/inheritable.rb +5 −0 Original line number Diff line number Diff line Loading @@ -4,11 +4,16 @@ module JsDuck::Builtins class Inheritable < Tag def initialize @pattern = "inheritable" @key = :inheritable end # @inheritable def parse(p) p.add_tag(:inheritable) end def process_doc(docs) true end end end
lib/jsduck/builtins/tag.rb +10 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,16 @@ module JsDuck::Builtins def parse(p) end # Defines the symbol under which the tag data is stored in final # member/class hash. attr_reader :key # Gets called with array of @tag data that was generated by # #parse. The return value is stored under :key in the resulting # member/class hash. def process_doc(docs) end # Defines the name of object property in Ext.define() # configuration which, when encountered, will cause the # #parse_ext_define method to be invoked. Loading
lib/jsduck/builtins_registry.rb +9 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ module JsDuck @patterns = {} @ext_define_patterns = {} @ext_define_defaults = {} @keys = {} load_tag_classes(File.dirname(__FILE__) + "/builtins") instantiate_tags end Loading @@ -33,6 +34,9 @@ module JsDuck if tag.ext_define_default @ext_define_defaults.merge!(tag.ext_define_default) end if tag.key @keys[tag.key] = tag end end end Loading @@ -49,6 +53,11 @@ module JsDuck # Default values for class config when Ext.define is encountered. attr_reader :ext_define_defaults # Accesses tag by key name - the symbol under which the tag data # is stored in final hash. def get_by_key(key) @keys[key] end end end
lib/jsduck/doc_ast.rb +6 −2 Original line number Diff line number Diff line Loading @@ -134,12 +134,16 @@ module JsDuck # Detects properties common for each doc-object and adds them def add_shared(hash, doc_map) hash.merge!({ :inheritable => !!doc_map[:inheritable], :hide => !!doc_map[:hide], :inheritdoc => extract(doc_map, :inheritdoc), :meta => detect_meta(doc_map), }) doc_map.each_pair do |key, value| if tag = BuiltinsRegistry.get_by_key(key) hash[key] = tag.process_doc(value) end end # copy :private also to main hash hash[:private] = hash[:meta][:private] ? true : nil Loading