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.


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

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


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

def klass
  @klass
end

#libraryObject

Returns the value of attribute library


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

def library
  @library
end

#nameObject

Returns the value of attribute name


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

def name
  @name
end

#typeObject Also known as: typename

Returns the value of attribute type


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

def type
  @type
end

Instance Method Details

#idstringObject


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

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

#inspectObject


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

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

#match?(m) ⇒ Boolean

Returns:

  • (Boolean)

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

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

#typecharObject


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

def typechar
  typename2char(@type)
end

#typemarkObject


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

def typemark
  typename2mark(@type)
end