Class: MotionBlender::Interpreters::OriginalInterpreter

Inherits:
Base
  • Object
show all
Defined in:
lib/motion_blender/interpreters/original_interpreter.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#collector, #object

Instance Method Summary collapse

Methods inherited from Base

#initialize, interprets, key, requirable?

Constructor Details

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

Instance Attribute Details

#originalObject (readonly)

Returns the value of attribute original.



8
9
10
# File 'lib/motion_blender/interpreters/original_interpreter.rb', line 8

def original
  @original
end

Instance Method Details

#interpretObject



10
11
12
13
14
15
# File 'lib/motion_blender/interpreters/original_interpreter.rb', line 10

def interpret
  dir = MotionBlender.config.motion_dirs.find { |d| file.start_with? d }
  raise 'not found in motion_dirs' unless dir
  arg = Pathname.new(file).relative_path_from(Pathname.new(dir))
  @original = candidates_for(arg).find(&:file?).try(&:to_s)
end