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

Remove #to_hash and #to_json methods from Class.

The #to_json wasn't used at all.

The #to_hash was only used by FullExporter where it could be replaced by
doing the cloning right in there.
parent 81ebeea8
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -99,15 +99,6 @@ module JsDuck
      end
    end

    # Returns copy of @doc hash
    def to_hash
      @doc.clone
    end

    def to_json(*a)
      to_hash.to_json(*a)
    end

    # Returns true when this class inherits from the specified class.
    # Also returns true when the class itself is the one we are asking about.
    def inherits_from?(class_name)
+4 −1
Original line number Diff line number Diff line
@@ -11,7 +11,10 @@ module JsDuck

    # Returns all data in Class object as hash.
    def export(cls)
      h = cls.to_hash
      # Make copy of the internal data structure of a class
      # so our modifications on it will be safe.
      h = cls.internal_doc.clone

      h[:members] = {}
      h[:statics] = {}
      Class.default_members_hash.each_key do |tagname|