Module: RTM::Axes::Characteristics
- Defined in:
- lib/rtm/axes/characteristics.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#atomify ⇒ Object
Returns the atomic values of these Characteristics.
- #result ⇒ Object (also: #tmapi)
-
#reverse_characteristics(type = :any) ⇒ Object
Returns the Topics these Characteristics belong to.
-
#reverse_reifier ⇒ Object
Returns the reifing Topics of these Characteristics only if such Topics exists.
-
#scope ⇒ Object
Returns the scope of these Characteristics.
Class Method Details
.extended(k) ⇒ Object
7 8 9 |
# File 'lib/rtm/axes/characteristics.rb', line 7 def self.extended(k) k.extend ArrayProxy end |
Instance Method Details
#atomify ⇒ Object
Returns the atomic values of these Characteristics.
:call-seq:
atomify -> Array of Strings
23 24 25 26 27 28 29 30 31 |
# File '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 |
#result ⇒ Object Also known as: tmapi
11 12 13 |
# File 'lib/rtm/axes/characteristics.rb', line 11 def result self.map{|i| i.construct} end |
#reverse_characteristics(type = :any) ⇒ Object
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 '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 |
#reverse_reifier ⇒ Object
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 '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 |
#scope ⇒ Object
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 '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 |