Class: Class

Inherits:
Object show all
Defined in:
lib/typecollection/class+inferred_type.rb

Instance Method Summary collapse

Instance Method Details

#__tc_collection_rootObject



2
3
4
5
6
7
8
# File 'lib/typecollection/class+inferred_type.rb', line 2

def __tc_collection_root()
  root = self
  while root.superclass && root.superclass.include?(TypeCollection::Base)
    root = root.superclass
  end
  root
end

#inferred_typeObject



10
11
12
13
14
# File 'lib/typecollection/class+inferred_type.rb', line 10

def inferred_type()
  klass_name = self.name.split("::").last
  root_name = __tc_collection_root.name.split("::").last
  klass_name.gsub(root_name, "")
end