Class: MotionBlender::Require

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Callbacks
Defined in:
lib/motion_blender/require.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(loader, method, arg) ⇒ Require

Returns a new instance of Require.



12
13
14
15
16
# File 'lib/motion_blender/require.rb', line 12

def initialize loader, method, arg
  @loader = loader
  @method = method
  @arg = arg
end

Instance Attribute Details

#argObject (readonly)

Returns the value of attribute arg.



9
10
11
# File 'lib/motion_blender/require.rb', line 9

def arg
  @arg
end

#autoload_const_nameObject

Returns the value of attribute autoload_const_name.



10
11
12
# File 'lib/motion_blender/require.rb', line 10

def autoload_const_name
  @autoload_const_name
end

#fileObject

Returns the value of attribute file.



10
11
12
# File 'lib/motion_blender/require.rb', line 10

def file
  @file
end

#loaderObject (readonly)

Returns the value of attribute loader.



9
10
11
# File 'lib/motion_blender/require.rb', line 9

def loader
  @loader
end

#methodObject (readonly)

Returns the value of attribute method.



9
10
11
# File 'lib/motion_blender/require.rb', line 9

def method
  @method
end

#traceObject

Returns the value of attribute trace.



10
11
12
# File 'lib/motion_blender/require.rb', line 10

def trace
  @trace
end

Instance Method Details

#autoload?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/motion_blender/require.rb', line 22

def autoload?
  method == :autoload
end

#match?(arg_or_file) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/motion_blender/require.rb', line 18

def match? arg_or_file
  [arg, file].compact.include?(arg_or_file)
end