Sha256: 10aa5dd60353ef0c6dd551fe2d00b79c2d88cea2e197dbe37df515d8cd3a8cca

Contents?: true

Size: 584 Bytes

Versions: 28

Compression:

Stored size: 584 Bytes

Contents

module PDoc
  module Models
    class Class < Entity
      include Container
      attr_accessor :constructor
      attr_accessor :superclass
      def attach_to_parent(parent)
        parent.classes << self
      end
      
      def subclasses
        @subclasses ||= []
      end
      
      def subclasses?
        @subclasses && !@subclasses.empty?
      end
      
      def to_hash
        super.merge({
          :superclass => superclass,
          :constructor => constructor,
          :subclasses => subclasses.map { |obj| obj.id }
        })
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
distil-0.14.4 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.3 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.2 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.2.a vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.1 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.1.a vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.i vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.h vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.g vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.d vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.c vendor/pdoc/lib/pdoc/models/class.rb
distil-0.14.0.b vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.6 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.5 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.4 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.3 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.2 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.1 vendor/pdoc/lib/pdoc/models/class.rb
distil-0.13.0 vendor/pdoc/lib/pdoc/models/class.rb