Method: Truck::Autoloader#each_base_nibble

Defined in:
lib/truck/autoloader.rb

#each_base_nibbleObject

given “Foo::Bar::Baz”, return [“Foo”, “Bar”, “Baz”]



58
59
60
61
62
63
64
65
# File 'lib/truck/autoloader.rb', line 58

def each_base_nibble
  return to_enum(:each_base_nibble) unless block_given?
  from.name.split('::').reduce Object do |mod, const|
    mod = mod.const_get const
    yield [mod, const]
    mod
  end
end