Class: Execution
- Inherits:
-
Object
- Object
- Execution
- Defined in:
- lib/Execution.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#caller_class ⇒ Object
Returns the value of attribute caller_class.
-
#caller_id ⇒ Object
Returns the value of attribute caller_id.
-
#caller_object ⇒ Object
Returns the value of attribute caller_object.
-
#child ⇒ Object
Returns the value of attribute child.
-
#control ⇒ Object
Returns the value of attribute control.
-
#is_base ⇒ Object
Returns the value of attribute is_base.
-
#is_reflecting ⇒ Object
Returns the value of attribute is_reflecting.
-
#klass ⇒ Object
Returns the value of attribute klass.
-
#method ⇒ Object
Returns the value of attribute method.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#reflections ⇒ Object
Returns the value of attribute reflections.
-
#unique_id ⇒ Object
Returns the value of attribute unique_id.
Instance Method Summary collapse
- #has_empty_reflections? ⇒ Boolean
- #has_finished_reflecting? ⇒ Boolean
-
#initialize(caller_object, method, number, stack) ⇒ Execution
constructor
Create Execution.
-
#is_reflecting? ⇒ Boolean
Is the Execution currently reflecting methods?.
Constructor Details
#initialize(caller_object, method, number, stack) ⇒ Execution
Create Execution.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/Execution.rb', line 25 def initialize(caller_object, method, number, stack) @time = Time.now.to_i @unique_id = @time + rand(1..99999) @base = nil @parent = nil @child = nil # Dependency. @stack = stack # Caller. @caller_object = caller_object @caller_id = caller_object.object_id @caller_class = caller_object.class @klass = @caller_class.to_s.to_sym @method = method # Reflections. @control = nil @reflections = Array.new(number) # State. if @stack.peek() == nil @is_base = true else @is_base = false @base = @stack.base() end @is_reflecting = false end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
9 10 11 |
# File 'lib/Execution.rb', line 9 def base @base end |
#caller_class ⇒ Object
Returns the value of attribute caller_class.
6 7 8 |
# File 'lib/Execution.rb', line 6 def caller_class @caller_class end |
#caller_id ⇒ Object
Returns the value of attribute caller_id.
5 6 7 |
# File 'lib/Execution.rb', line 5 def caller_id @caller_id end |
#caller_object ⇒ Object
Returns the value of attribute caller_object.
4 5 6 |
# File 'lib/Execution.rb', line 4 def caller_object @caller_object end |
#child ⇒ Object
Returns the value of attribute child.
11 12 13 |
# File 'lib/Execution.rb', line 11 def child @child end |
#control ⇒ Object
Returns the value of attribute control.
12 13 14 |
# File 'lib/Execution.rb', line 12 def control @control end |
#is_base ⇒ Object
Returns the value of attribute is_base.
15 16 17 |
# File 'lib/Execution.rb', line 15 def is_base @is_base end |
#is_reflecting ⇒ Object
Returns the value of attribute is_reflecting.
14 15 16 |
# File 'lib/Execution.rb', line 14 def is_reflecting @is_reflecting end |
#klass ⇒ Object
Returns the value of attribute klass.
7 8 9 |
# File 'lib/Execution.rb', line 7 def klass @klass end |
#method ⇒ Object
Returns the value of attribute method.
8 9 10 |
# File 'lib/Execution.rb', line 8 def method @method end |
#parent ⇒ Object
Returns the value of attribute parent.
10 11 12 |
# File 'lib/Execution.rb', line 10 def parent @parent end |
#reflections ⇒ Object
Returns the value of attribute reflections.
13 14 15 |
# File 'lib/Execution.rb', line 13 def reflections @reflections end |
#unique_id ⇒ Object
Returns the value of attribute unique_id.
3 4 5 |
# File 'lib/Execution.rb', line 3 def unique_id @unique_id end |
Instance Method Details
#has_empty_reflections? ⇒ Boolean
58 59 60 |
# File 'lib/Execution.rb', line 58 def has_empty_reflections? @reflections.include? nil end |
#has_finished_reflecting? ⇒ Boolean
69 70 71 72 73 74 75 76 77 |
# File 'lib/Execution.rb', line 69 def has_finished_reflecting? if is_reflecting? return false end if has_empty_reflections? return false end return true end |
#is_reflecting? ⇒ Boolean
Is the Execution currently reflecting methods?
65 66 67 |
# File 'lib/Execution.rb', line 65 def is_reflecting? @is_reflecting end |