Sha256: 3a45dc3d00e4d16ab00e8184ab18f5f32c964fee7b53e51434ed82740e4a295b

Contents?: true

Size: 443 Bytes

Versions: 2

Compression:

Stored size: 443 Bytes

Contents

module Micron
  class Runner
    class Clazz

      private

      # Compat fix for Ruby 1.9.x
      def name_to_const

        names = name.split('::')
        names.shift if names.empty? || names.first.empty?

        constant = Module
        names.each do |name|
          constant = constant.const_defined?(name) ? constant.const_get(name) : constant.const_missing(name)
        end

        return constant
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
micron-0.5.1 lib/micron/runner/clazz19.rb
micron-0.5.0 lib/micron/runner/clazz19.rb