Module: RTM::Axes::Characteristics
- Defined in:
- rtm/lib/rtm/axes/characteristics.rb,
rtm/spec/rtm/axes/characteristics_spec.rb
Class Method Summary
Instance Method Summary
-
- (Object) atomify
Returns the atomic values of these Characteristics.
- - (Object) result (also: #tmapi)
-
- (Object) reverse_characteristics(type = :any)
Returns the Topics these Characteristics belong to.
-
- (Object) reverse_reifier
Returns the reifing Topics of these Characteristics only if such Topics exists.
-
- (Object) scope
Returns the scope of these Characteristics.
Class Method Details
+ (Object) extended(k)
7 8 9 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 7 def self.extended(k) k.extend ArrayProxy end |
Instance Method Details
- (Object) atomify
Returns the atomic values of these Characteristics.
:call-seq:
atomify -> Array of Strings
23 24 25 26 27 28 29 30 31 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 23 def atomify #self = Array of TopicProxies #containee: RTM::Axes::Topic #send -> Array of (String or nil)s _res = self.inject([]){|all,containee| all << containee.send(:atomify)}.flatten _res = _res.select{|i| i} ### NO UNIQUE _res.extend(Strings) end |
- (Object) result Also known as: tmapi
11 12 13 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 11 def result self.map{|i| i.construct} end |
- (Object) reverse_characteristics(type = :any)
Returns the Topics these Characteristics belong to. The optional argument identifier filters the Characteristics for their types. If the type does not match, the Topic is not returned.
The identifier may be a topic reference.
:call-seq:
reverse_characteristics -> Array of Topic reverse_characteristics(identifier) -> Array of Topic or empty Array
46 47 48 49 50 51 52 53 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 46 def reverse_characteristics(type=:any) _res = self.inject([]){|all,containee| all << containee.send(:reverse_characteristics,type)}.flatten _res = _res.select{|i| i} ### FLAG UNIQUE ### _res = _res.map{|i| i.construct}.uniq.map{|i| i.axes} ### ### _res.extend(Topics) end |
- (Object) reverse_reifier
Returns the reifing Topics of these Characteristics only if such Topics exists.
The result may be empty.
:call-seq:
reverse_reified -> Array of Topics
65 66 67 68 69 70 71 72 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 65 def reverse_reifier _res = self.inject([]){|all,containee| all << containee.send(:reverse_reifier)}.flatten _res = _res.select{|i| i} ### FLAG UNIQUE ### _res = _res.map{|i| i.construct}.uniq.map{|i| i.axes} ### ### _res.extend(Topics) end |
- (Object) scope
Returns the scope of these Characteristics.
The result may be empty.
:call-seq:
scope -> Array of Topics
83 84 85 86 87 88 89 90 |
# File 'rtm/lib/rtm/axes/characteristics.rb', line 83 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 |