Class: Control

Inherits:
Reflection show all
Defined in:
lib/Control.rb

Constant Summary

Constants inherited from Reflection

Reflection::COUNT, Reflection::FAIL, Reflection::INPUT, Reflection::MESSAGE, Reflection::OUTPUT, Reflection::PASS, Reflection::STATUS, Reflection::TIME, Reflection::TYPE, Reflection::VALUE

Instance Attribute Summary

Attributes inherited from Reflection

#clone

Instance Method Summary collapse

Methods inherited from Reflection

#initialize, #normalize_input, #normalize_output, #normalize_value, #result

Constructor Details

This class inherits a constructor from Reflection

Instance Method Details

#reflect(*args) ⇒ Object

Reflect on a method.

Creates a shadow execution stack.

Parameters:

  • method
    • The name of the method.

  • *args
    • The method arguments.

Returns:

    • A reflection hash.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/Control.rb', line 15

def reflect(*args)

  @input = *args

  # Action method with new arguments.
  begin
    @output = @clone.send(@method, *@input)
  # When fail.
  rescue StandardError => message
    @status = FAIL
    @message = message
  # When pass.
  else
    @status = PASS
  end

end