Class: RTM::Axes::Association

Inherits:
ItemProxy show all
Defined in:
rtm/lib/rtm/axes.rb,
rtm/lib/rtm/axes/association.rb,
rtm/spec/rtm/axes/association_spec.rb

Overview

--- Association --------------------------------------#

Instance Method Summary

Methods inherited from Proxy

#initialize

Constructor Details

This class inherits a constructor from RTM::Axes::Proxy

Instance Method Details

- (Object) players(type = :any)

Returns all Role players of Roles in this Association.

The optional identifier specifies the type of the Roles to be considered. The identifier may be a topic reference.

Multiple instances of the same Topic are possible. The result may be empty.

:call-seq:

  players -> Array of Topics
  players(identifier) -> Array of Topics


22
23
24
25
# File 'rtm/lib/rtm/axes/association.rb', line 22

def players(type=:any)
  _res = @construct.players(type).map{|r| r.axes}
  _res.extend(Topics)
end

- (Object) reverse_reifier

Returns the reifing Topic or nil, if no such Topic exists.

:call-seq:

  reverse_reified -> Topic or nil


34
35
36
37
# File 'rtm/lib/rtm/axes/association.rb', line 34

def reverse_reifier
  _res = @construct.reifier #Topic or nil
  RTM::Axes::Topic.new(_res,@tm) if _res
end

- (Object) roles

Returns all Topics that are types of Roles of this Association. Multiple instances of the same Topic are possible.

The result may be empty.

:call-seq:

  roles -> Array of Topics


49
50
51
52
53
# File 'rtm/lib/rtm/axes/association.rb', line 49

def roles
  _res = @construct.getRoles.map {|r| r.getType }
  _res = _res.map{|r| r.axes}
  _res.extend(Topics)
end

- (Object) scope

Returns the scope of this Association.

The result may be empty.

:call-seq:

  scope -> Array of Topics


64
65
66
67
# File 'rtm/lib/rtm/axes/association.rb', line 64

def scope
  _res = @construct.scope.map{|r| r.axes} #Array of Topics or empty Array
  _res.extend(Topics)
end