Class: BitClust::FunctionEntry
- Inherits:
-
Entry
show all
- Defined in:
- lib/bitclust/functionentry.rb
Constant Summary
Constants inherited
from Entry
Entry::BracketLink
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
-
#id ⇒ Object
(also: #name, #label)
readonly
Returns the value of attribute id.
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, display_typemark, 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
Returns a new instance of FunctionEntry.
22
23
24
25
26
|
# File 'lib/bitclust/functionentry.rb', line 22
def initialize(db, id)
super db
@id = id
init_properties
end
|
Instance Attribute Details
#id ⇒ Object
Also known as:
name, label
Returns the value of attribute id.
51
52
53
|
# File 'lib/bitclust/functionentry.rb', line 51
def id
@id
end
|
Instance Method Details
#<=>(other) ⇒ Object
36
37
38
|
# File 'lib/bitclust/functionentry.rb', line 36
def <=>(other)
@id.casecmp(other.id)
end
|
#callable? ⇒ Boolean
67
68
69
|
# File 'lib/bitclust/functionentry.rb', line 67
def callable?
not params().empty?
end
|
#description ⇒ Object
85
86
87
|
# File 'lib/bitclust/functionentry.rb', line 85
def description
description_text(source.split(/\n\n+/, 2)[0].strip)
end
|
76
77
78
79
80
81
82
83
|
# File 'lib/bitclust/functionentry.rb', line 76
def
if callable?
base = "#{type()} #{name()}#{params()}"
else
base = "#{type()} #{name()}"
end
"#{private? ? 'static ' : ''}#{base}"
end
|
28
29
30
|
# File 'lib/bitclust/functionentry.rb', line 28
def inspect
"\#<function #{@id}>"
end
|
#name_match?(re) ⇒ Boolean
32
33
34
|
# File 'lib/bitclust/functionentry.rb', line 32
def name_match?(re)
re =~ name()
end
|
#public? ⇒ Boolean
63
64
65
|
# File 'lib/bitclust/functionentry.rb', line 63
def public?
not private?
end
|
#type_label ⇒ Object
Also known as:
kind
71
72
73
|
# File 'lib/bitclust/functionentry.rb', line 71
def type_label
macro? ? 'macro' : 'function'
end
|