Sha256: 3a74740f9dc906da4e40e3cf8ca308f33501ab2c23f3e61770b52588d37e72f6

Contents?: true

Size: 1.08 KB

Versions: 11

Compression:

Stored size: 1.08 KB

Contents

#
# bitclust/docentry.rb
#
# Copyright (c) 2006-2008 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the Ruby License.
#

require 'bitclust/entry'
require 'bitclust/exception'

module BitClust

  class DocEntry < Entry

    def self.type_id
      :doc
    end

    def initialize(db, id)
      super db
      @id = id
      init_properties
    end

    attr_reader :id

    def ==(other)
      @id == other.id
    end

    alias eql? ==

    def hash
      @id.hash
    end

    def <=>(other)
      @id.casecmp(other.id)
    end

    def name
      libid2name(@id)
    end

    alias label name

    def labels
      [label()]
    end
    
    def name?(n)
      name() == n
    end

    persistent_properties {
      property :title,    'String'
      property :source,   'String'
    }

    def inspect
      "#<doc #{@id}>"
    end

    def classes
      @db.classes
    end

    def error_classes
      classes.select{|c| c.error_class? }
    end
    
    def methods
      @db.methods
    end

    def libraries
      @db.libraries
    end
  end

end

Version data entries

11 entries across 7 versions & 1 rubygems

Version Path
bitclust-core-0.7.0 lib/bitclust/docentry.rb
bitclust-core-0.6.0 lib/bitclust/docentry.rb
bitclust-core-0.5.5 lib/bitclust/docentry.rb
bitclust-core-0.5.4 lib/bitclust/docentry.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/lib/bitclust/docentry.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/lib/bitclust/docentry.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/lib/bitclust/docentry.rb
bitclust-core-0.5.3 lib/bitclust/docentry.rb
bitclust-core-0.5.2 lib/bitclust/docentry.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/lib/bitclust/docentry.rb
bitclust-core-0.5.1 lib/bitclust/docentry.rb