Class: MotionBlender::Interpreters::AutoloadInterpreter

Inherits:
RequireInterpreter show all
Defined in:
lib/motion_blender/interpreters/autoload_interpreter.rb

Direct Known Subclasses

ModuleAutoloadInterpreter

Instance Attribute Summary

Attributes inherited from Base

#collector, #object

Instance Method Summary collapse

Methods inherited from RequireInterpreter

#candidates

Methods included from Requirable

#find_require, #resolve_path

Methods inherited from Base

#initialize, interprets, key, requirable?

Constructor Details

This class inherits a constructor from MotionBlender::Interpreters::Base

Instance Method Details

#interpret(const_name, arg) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/motion_blender/interpreters/autoload_interpreter.rb', line 8

def interpret const_name, arg
  req = super arg
  req.autoload_const_name =
    if object.is_a? Module
      [*object.name.sub(/^#<.+?>::/, ''), const_name].join('::')
    else
      const_name.to_s
    end
end