Module: RPCMapper::Associations::Common::ClassMethods

Defined in:
lib/rpc_mapper/associations/common.rb

Instance Method Summary collapse

Instance Method Details

#base_class_name(klass) ⇒ Object



6
7
8
# File 'lib/rpc_mapper/associations/common.rb', line 6

def base_class_name(klass)
  klass.to_s.split("::").last
end

#resolve_leaf_klass(klass) ⇒ Object

TRP: This will return the most recent extension of klass or klass if it is a leaf node in the hierarchy



11
12
13
# File 'lib/rpc_mapper/associations/common.rb', line 11

def resolve_leaf_klass(klass)
  extension_map[klass].empty? ? klass : resolve_leaf_klass(extension_map[klass].last)
end