Class: Class
Instance Method Summary collapse
Instance Method Details
#inferred_type ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/typecollection/class+inferred_type.rb', line 2 def inferred_type() klass_name = self.name.split("::").last parent_klass = self.superclass while(parent_klass != nil) check = /#{parent_klass.name.split("::").last}$/ if (klass_name.match(check)) return klass_name.gsub(check, '') end parent_klass = parent_klass.superclass end return nil end |