Class: Unmangler::Base
- Inherits:
-
Object
- Object
- Unmangler::Base
- Defined in:
- lib/unmangler/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #assert(cond) ⇒ Object
- #isdigit(c) ⇒ Object
-
#safe_unmangle(name, *args) ⇒ Object
same as ‘unmangle’, but catches all exceptions and returns original name if can not unmangle.
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 |