Loading lib/jsduck/class.rb +3 −1 Original line number Diff line number Diff line Loading @@ -337,8 +337,10 @@ module JsDuck ms = ms.find_all {|m| m[:tagname] == query[:tagname] } end if query[:static] if query[:static] == true ms = ms.find_all {|m| m[:meta] && m[:meta][:static] } elsif query[:static] == false ms = ms.reject {|m| m[:meta] && m[:meta][:static] } end ms Loading spec/class_spec.rb +9 −1 Original line number Diff line number Diff line Loading @@ -71,10 +71,14 @@ describe JsDuck::Class do cls.find_members(:tagname => :cfg).length.should == 0 end it "finds no statics when there are no static members" do it "finds no members when :static => true specified" do cls.find_members(:static => true).length.should == 0 end it "finds all members when :static => false specified" do cls.find_members(:static => false).length.should == 6 end it "finds member in itself" do cls.find_members(:name => "inChild").length.should == 1 end Loading Loading @@ -162,6 +166,10 @@ describe JsDuck::Class do it "finds all static members" do cls.find_members(:static => true).length.should == 4 end it "finds no static members when :static=>false specified" do cls.find_members(:static => false).length.should == 0 end end describe "when #find_members called before" do Loading Loading
lib/jsduck/class.rb +3 −1 Original line number Diff line number Diff line Loading @@ -337,8 +337,10 @@ module JsDuck ms = ms.find_all {|m| m[:tagname] == query[:tagname] } end if query[:static] if query[:static] == true ms = ms.find_all {|m| m[:meta] && m[:meta][:static] } elsif query[:static] == false ms = ms.reject {|m| m[:meta] && m[:meta][:static] } end ms Loading
spec/class_spec.rb +9 −1 Original line number Diff line number Diff line Loading @@ -71,10 +71,14 @@ describe JsDuck::Class do cls.find_members(:tagname => :cfg).length.should == 0 end it "finds no statics when there are no static members" do it "finds no members when :static => true specified" do cls.find_members(:static => true).length.should == 0 end it "finds all members when :static => false specified" do cls.find_members(:static => false).length.should == 6 end it "finds member in itself" do cls.find_members(:name => "inChild").length.should == 1 end Loading Loading @@ -162,6 +166,10 @@ describe JsDuck::Class do it "finds all static members" do cls.find_members(:static => true).length.should == 4 end it "finds no static members when :static=>false specified" do cls.find_members(:static => false).length.should == 0 end end describe "when #find_members called before" do Loading