Sha256: a4255d81f0423d60b2a392ae70bec61b1c06787d681ec9b5d55a85da3d5a267c

Contents?: true

Size: 681 Bytes

Versions: 29

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

module Orthoses
  class Walk
    def initialize(loader, root:)
      @loader = loader
      @root = root
    end

    def call
      @loader.call.tap do |store|
        root = Object.const_get(@root) if @root.instance_of?(String)
        Utils.module_name(root)&.then { |root_name| store[root_name] }
        Orthoses::Utils.each_const_recursive(root) do |current, const, val|
          if val.kind_of?(Module)
            Utils.module_name(val)&.then do |val_name|
              Orthoses.logger.debug("Add [#{val_name}] on #{__FILE__}:#{__LINE__}")
              store[val_name]
            end
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
orthoses-1.17.0 lib/orthoses/walk.rb
orthoses-1.16.0 lib/orthoses/walk.rb
orthoses-1.15.0 lib/orthoses/walk.rb
orthoses-1.14.0 lib/orthoses/walk.rb
orthoses-1.13.0 lib/orthoses/walk.rb
orthoses-1.12.0 lib/orthoses/walk.rb
orthoses-1.11.0 lib/orthoses/walk.rb
orthoses-1.10.0 lib/orthoses/walk.rb
orthoses-1.9.0 lib/orthoses/walk.rb
orthoses-1.8.0 lib/orthoses/walk.rb
orthoses-1.7.0 lib/orthoses/walk.rb
orthoses-1.6.0 lib/orthoses/walk.rb
orthoses-1.5.0 lib/orthoses/walk.rb
orthoses-1.4.0 lib/orthoses/walk.rb
orthoses-1.3.0 lib/orthoses/walk.rb
orthoses-1.2.0 lib/orthoses/walk.rb
orthoses-1.1.0 lib/orthoses/walk.rb
orthoses-1.0.0 lib/orthoses/walk.rb
orthoses-0.11.0 lib/orthoses/walk.rb
orthoses-0.10.0 lib/orthoses/walk.rb