Class: Unmangler::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/unmangler/base.rb

Direct Known Subclasses

Borland, MSVC

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.safe_unmangle(*args) ⇒ Object



23
24
25
# File 'lib/unmangler/base.rb', line 23

def self.safe_unmangle *args
  new.safe_unmangle(*args)
end

.unmangle(*args) ⇒ Object



19
20
21
# File 'lib/unmangler/base.rb', line 19

def self.unmangle *args
  new.unmangle(*args)
end

Instance Method Details

#assert(cond) ⇒ Object



7
8
9
# File 'lib/unmangler/base.rb', line 7

def assert cond
  raise unless cond
end

#isdigit(c) ⇒ Object



3
4
5
# File 'lib/unmangler/base.rb', line 3

def isdigit c
  c =~ /\A\d\Z/
end

#safe_unmangle(name, *args) ⇒ Object

same as ‘unmangle’, but catches all exceptions and returns original name if can not unmangle



13
14
15
16
17
# File 'lib/unmangler/base.rb', line 13

def safe_unmangle name, *args
  unmangle name, *args
rescue
  name
end