Class: Execution

Inherits:
Object
  • Object
show all
Defined in:
lib/Execution.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object, reflection_count) ⇒ Execution

Returns a new instance of Execution.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/Execution.rb', line 11

def initialize(object, reflection_count)

  @object = object
  @caller_id = object.object_id
  @caller_class = object.class
  @parent = nil
  @child = nil

  @reflections = Array.new(reflection_count)
  @is_reflecting = false

end

Instance Attribute Details

#caller_classObject

Returns the value of attribute caller_class.



5
6
7
# File 'lib/Execution.rb', line 5

def caller_class
  @caller_class
end

#caller_idObject

Returns the value of attribute caller_id.



4
5
6
# File 'lib/Execution.rb', line 4

def caller_id
  @caller_id
end

#childObject

Returns the value of attribute child.



7
8
9
# File 'lib/Execution.rb', line 7

def child
  @child
end

#is_reflectingObject

Returns the value of attribute is_reflecting.



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

def is_reflecting
  @is_reflecting
end

#objectObject

Returns the value of attribute object.



3
4
5
# File 'lib/Execution.rb', line 3

def object
  @object
end

#parentObject

Returns the value of attribute parent.



6
7
8
# File 'lib/Execution.rb', line 6

def parent
  @parent
end

#reflectionsObject

Returns the value of attribute reflections.



8
9
10
# File 'lib/Execution.rb', line 8

def reflections
  @reflections
end

Instance Method Details

#has_empty_reflections?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/Execution.rb', line 24

def has_empty_reflections?
  @reflections.include? nil
end

#has_finished_reflecting?Boolean

Returns:

  • (Boolean)


35
36
37
38
39
40
41
42
43
# File 'lib/Execution.rb', line 35

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?

Returns:

  • (Boolean)


31
32
33
# File 'lib/Execution.rb', line 31

def is_reflecting?
  @is_reflecting
end