Module: RTM::Axes::Associations

Defined in:
rtm/lib/rtm/axes/associations.rb,
rtm/spec/rtm/axes/associations_spec.rb

Class Method Summary

Instance Method Summary

Class Method Details

+ (Object) extended(k)



7
8
9
# File 'rtm/lib/rtm/axes/associations.rb', line 7

def self.extended(k)
  k.extend ArrayProxy
end

Instance Method Details

- (Object) players(type = :any)

Returns all Role players of Roles in these Associations.

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


30
31
32
33
34
35
# File 'rtm/lib/rtm/axes/associations.rb', line 30

def players(type=:any)
  _res = self.inject([]){|all,containee| all << containee.send(:players,type)}.flatten
  ### NO UNIQUE ###
  _res = _res.extend(Topics)
  _res
end

- (Object) result Also known as: tmapi



11
12
13
# File 'rtm/lib/rtm/axes/associations.rb', line 11

def result
  self.map{|i| i.construct}
end

- (Object) reverse_reifier

Returns the reifing Topics of these Assocations only if such Topics exist.

The result may be empty.

:call-seq:

  reverse_reified -> Array of Topics


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

def reverse_reifier
  _res = self.inject([]){|all,containee| all << containee.send(:reverse_reifier)}.flatten
  _res = _res.select{|i| i}
  ### NO UNIQUE NEEDED
  _res = _res.extend(Topics)
  _res
end

- (Object) roles

Returns all Topics that are types of Roles in these Associations. Multiple instances of the same Topic are possible.

The result may be empty.

:call-seq:

  roles -> Array of Topics


65
66
67
68
69
70
# File 'rtm/lib/rtm/axes/associations.rb', line 65

def roles
  _res = self.inject([]){|all,containee| all << containee.send(:roles)}.flatten
  ### NO UNIQUE ###
  _res = _res.extend(Topics)
  _res
end

- (Object) scope

Returns the scope of these Associations.

The result may be empty.

:call-seq:

  scope -> Array of Topics


81
82
83
84
85
86
87
88
# File 'rtm/lib/rtm/axes/associations.rb', line 81

def scope
  _res = self.inject([]){|all,containee| all << containee.send(:scope)}.flatten
  ### FLAG UNIQUE ###
  _res = _res.map{|i| i.construct}.uniq.map{|i| i.axes}
  ###             ###
  _res = _res.extend(Topics)
  _res
end