Class: BitClust::MethodID

Inherits:
Object show all
Includes:
NameUtils
Defined in:
lib/bitclust/methodid.rb

Overview

Represents infomation to identify a method (library, class/module, type and name.)

A MethodID has #library, #klass, #typename, and method name. #library, #klass, #typename must be an object.

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

Instance Method Summary collapse

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(library = nil, klass = nil, type = nil, name = nil) ⇒ MethodID

Returns a new instance of MethodID.



25
26
27
28
29
30
# File 'lib/bitclust/methodid.rb', line 25

def initialize(library = nil, klass = nil, type = nil, name = nil)
  @library = library
  @klass = klass
  @type = type
  @name = name
end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



33
34
35
# File 'lib/bitclust/methodid.rb', line 33

def klass
  @klass
end

#libraryObject

Returns the value of attribute library.



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

def library
  @library
end

#nameObject

Returns the value of attribute name.



35
36
37
# File 'lib/bitclust/methodid.rb', line 35

def name
  @name
end

#typeObject Also known as: typename

Returns the value of attribute type.



34
35
36
# File 'lib/bitclust/methodid.rb', line 34

def type
  @type
end

Instance Method Details

#idstringObject



57
58
59
# File 'lib/bitclust/methodid.rb', line 57

def idstring
  build_method_id(@library.id, @klass.id, @type, @name)
end

#inspectObject



37
38
39
# File 'lib/bitclust/methodid.rb', line 37

def inspect
  "#<methodid #{@library.name}.#{@klass.name}#{typemark()}#{@name}>"
end

#match?(m) ⇒ Boolean

Returns:

  • (Boolean)


41
42
43
44
45
# File 'lib/bitclust/methodid.rb', line 41

def match?(m)
  m.name == @name and
  m.type == @type and
  m.library == @library
end

#typecharObject



49
50
51
# File 'lib/bitclust/methodid.rb', line 49

def typechar
  typename2char(@type)
end

#typemarkObject



53
54
55
# File 'lib/bitclust/methodid.rb', line 53

def typemark
  typename2mark(@type)
end