Class: RTM::Axes::Association

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

Overview

—- Association ———————————————————#

Instance Attribute Summary

Attributes inherited from Proxy

#construct, #tm

Instance Method Summary collapse

Methods inherited from Proxy

#initialize

Constructor Details

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

Instance Method Details

#players(type = :any) ⇒ Object

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 'lib/rtm/axes/association.rb', line 22

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

#reverse_reifierObject

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

:call-seq:

reverse_reified -> Topic or nil


34
35
36
37
# File '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

#rolesObject

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 '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

#scopeObject

Returns the scope of this Association.

The result may be empty.

:call-seq:

scope -> Array of Topics


64
65
66
67
# File '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