Module: Arf::Types::Mixin::ClassMethods

Defined in:
lib/arf/types/mixin.rb

Instance Method Summary collapse

Instance Method Details

#find_type(named) ⇒ Object



14
15
16
17
18
19
20
21
22
23
# File 'lib/arf/types/mixin.rb', line 14

def find_type(named)
  components = named.split("::")
  if components.first.empty?
    # Look from the root, starting at Object
    ::Arf::Types.lookup_type(Object, components[1...], direction: :down)
  else
    # Look from local scope upwards
    ::Arf::Types.lookup_type(self, components, direction: :up)
  end
end