Module: MobyBehaviour::ObjectComposition

Includes:
Behaviour
Included in:
MobyBase::StateObject
Defined in:
lib/tdriver/base/behaviour/behaviours/object_composition.rb

Overview

description

Generic methods for test object and SUT composition

behaviour

GenericObjectComposition

requires

*

input_type

*

sut_type

*

sut_version

*

objects

*;sut

Instance Method Summary collapse

Instance Method Details

#add_child(new_child_object) ⇒ Object

Adds a test object as a child of this object

params

new_child_object

Object to be added

returns

?

raises



91
92
93
94
95
96
97
# File 'lib/tdriver/base/behaviour/behaviours/object_composition.rb', line 91

def add_child( new_child_object ) 

    warn("warning: Deprecated method, use @child_object_cache.add_object instead of this method")

	@_child_object_cache.merge!( new_child_object.hash => new_child_object )

end

#add_parent(parent_object) ⇒ Object

Adds a object as a parent of this object

params

parent_object Object to be added

returns

?

raises



62
63
64
65
66
67
68
# File 'lib/tdriver/base/behaviour/behaviours/object_composition.rb', line 62

def add_parent( parent_object )

    warn("warning: Deprecated method, use store to @parent instead of using this method") 

	@parent = parent_object

end

#remove_child(target_child_object) ⇒ Object

Removes target_child_object from the Set of child objects

params

target_test_object

TestObject to be removed

returns

?

raises



106
107
108
109
110
111
112
# File 'lib/tdriver/base/behaviour/behaviours/object_composition.rb', line 106

def remove_child( target_child_object )

    warn("warning: Deprecated method, use @child_object_cache.add_object instead of this method")

	@_child_object_cache.delete( target_child_object.hash )

end

#remove_parentObject

removes association to parent object from self

params

none

returns

?



76
77
78
79
80
81
82
# File 'lib/tdriver/base/behaviour/behaviours/object_composition.rb', line 76

def remove_parent()

    warn("warning: Deprecated method, set @parent to nil instead of using this method") 

	@parent = nil

end