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.



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

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Class Method Details

.type_idObject



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

def self.type_id
  :doc
end

Instance Method Details

#<=>(other) ⇒ Object



42
43
44
# File 'lib/bitclust/docentry.rb', line 42

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

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



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

def ==(other)
  return false if self.class != other.class
  @id == other.id
end

#classesObject



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

def classes
  @db.classes
end

#descriptionObject



86
87
88
# File 'lib/bitclust/docentry.rb', line 86

def description
  source.split(/\n\n/, 2)[0].strip
end

#error_classesObject



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

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

#hashObject



38
39
40
# File 'lib/bitclust/docentry.rb', line 38

def hash
  @id.hash
end

#inspectObject



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

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

#labelsObject



52
53
54
# File 'lib/bitclust/docentry.rb', line 52

def labels
  [label()]
end

#librariesObject



82
83
84
# File 'lib/bitclust/docentry.rb', line 82

def libraries
  @db.libraries
end

#methodsObject



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

def methods
  @db.methods
end

#nameObject Also known as: label



46
47
48
# File 'lib/bitclust/docentry.rb', line 46

def name
  libid2name(@id)
end

#name?(n) ⇒ Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/bitclust/docentry.rb', line 56

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