Class: Atk::RelationSet

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#add(relation) ⇒ nil

Add a new relation to the current relation set if it is not already present. This function ref’s the AtkRelation so the caller of this function should unref it to ensure that it will be destroyed when the AtkRelationSet is destroyed.

Parameters:

Returns:

  • (nil)

#add_relation_by_type(relationship, target) ⇒ nil

Add a new relation of the specified type with the specified target to the current relation set if the relation set does not contain a relation of that type. If it is does contain a relation of that typea the target is added to the relation.

Parameters:

Returns:

  • (nil)

#contains(relationship) ⇒ TrueClass

Determines whether the relation set contains a relation that matches the specified type. in set, false otherwise

Parameters:

Returns:

  • (TrueClass)

    true if relationship is the relationship type of a relation

#contains_target(relationship, target) ⇒ TrueClass

Determines whether the relation set contains a relation that matches the specified pair formed by type relationship and object target. type relationship with an object target, false otherwise

Parameters:

Returns:

  • (TrueClass)

    true if set contains a relation with the relationship

#get_relation(i) ⇒ Atk::Relation

Determines the relation at the specified position in the relation set. position i in the set.

Parameters:

  • i (Integer)

    a gint representing a position in the set, starting from 0.

Returns:

#get_relation_by_type(relationship) ⇒ Atk::Relation

Finds a relation that matches the specified type. specified type.

Parameters:

Returns:

  • (Atk::Relation)

    an Atk::Relation, which is a relation matching the

#n_relationsInteger

Determines the number of relations in a relation set.

Returns:

  • (Integer)

    an integer representing the number of relations in the set.

#newAtk::RelationSet

Creates a new empty relation set.

Returns:

#remove(relation) ⇒ nil

Removes a relation from the relation set. This function unref’s the Atk::Relation so it will be deleted unless there is another reference to it.

Parameters:

Returns:

  • (nil)