Class: BitClust::DocEntry

Inherits:
Entry show all
Defined in:
lib/bitclust/docentry.rb

Overview

Entry for general documents (doc/*/.rd, etc.)

Constant Summary

Constants included from NameUtils

NameUtils::CHAR_TO_MARK, NameUtils::CHAR_TO_NAME, NameUtils::CLASS_NAME_RE, NameUtils::CLASS_PATH_RE, NameUtils::CONST_PATH_RE, NameUtils::CONST_RE, NameUtils::GVAR_RE, NameUtils::LIBNAME_RE, NameUtils::MARK_TO_CHAR, NameUtils::MARK_TO_NAME, NameUtils::METHOD_NAME_RE, NameUtils::METHOD_SPEC_RE, NameUtils::MID, NameUtils::NAME_TO_CHAR, NameUtils::NAME_TO_MARK, NameUtils::TYPEMARK_RE

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entry

#detail_source, #encoding, #loaded?, persistent_properties, property, #save, #synopsis_source, #type_id

Methods included from NameUtils

build_method_id, classid2name, classname2id, classname?, decodeid, decodename_fs, decodename_url, encodeid, encodename_fs, encodename_rdocurl, encodename_url, functionname?, gvarname?, html_filename, libid2name, libname2id, libname?, method_spec?, methodid2classid, methodid2libid, methodid2mname, methodid2specparts, methodid2specstring, methodid2typechar, methodid2typemark, methodid2typename, methodname?, split_method_id, split_method_spec, typechar2mark, typechar2name, typechar?, typemark2char, typemark2name, typemark?, typename2char, typename2mark, typename?

Constructor Details

#initialize(db, id) ⇒ DocEntry

Returns a new instance of DocEntry.


22
23
24
25
26
# File 'lib/bitclust/docentry.rb', line 22

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id


28
29
30
# File 'lib/bitclust/docentry.rb', line 28

def id
  @id
end

Class Method Details

.type_idObject


18
19
20
# File 'lib/bitclust/docentry.rb', line 18

def self.type_id
  :doc
end

Instance Method Details

#<=>(other) ⇒ Object


40
41
42
# File 'lib/bitclust/docentry.rb', line 40

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

#==(other) ⇒ Object Also known as: eql?


30
31
32
# File 'lib/bitclust/docentry.rb', line 30

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

#classesObject


67
68
69
# File 'lib/bitclust/docentry.rb', line 67

def classes
  @db.classes
end

#error_classesObject


71
72
73
# File 'lib/bitclust/docentry.rb', line 71

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

#hashObject


36
37
38
# File 'lib/bitclust/docentry.rb', line 36

def hash
  @id.hash
end

#inspectObject


63
64
65
# File 'lib/bitclust/docentry.rb', line 63

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

#labelsObject


50
51
52
# File 'lib/bitclust/docentry.rb', line 50

def labels
  [label()]
end

#librariesObject


79
80
81
# File 'lib/bitclust/docentry.rb', line 79

def libraries
  @db.libraries
end

#methodsObject


75
76
77
# File 'lib/bitclust/docentry.rb', line 75

def methods
  @db.methods
end

#nameObject Also known as: label


44
45
46
# File 'lib/bitclust/docentry.rb', line 44

def name
  libid2name(@id)
end

#name?(n) ⇒ Boolean

Returns:

  • (Boolean)

54
55
56
# File 'lib/bitclust/docentry.rb', line 54

def name?(n)
  name() == n
end