Class: RTM::Axes::String
- Defined in:
- lib/rtm/axes.rb,
lib/rtm/axes/string.rb
Overview
—- RTM::Axes::String —————————————#
Instance Attribute Summary
Attributes inherited from Proxy
Instance Method Summary collapse
-
#reverse_atomify ⇒ Object
Returns all Names and Occurrences which have String as data value.
-
#reverse_indicators ⇒ Object
Returns the Topic which has this String as indicator (subject identifier) or nil if no such Topic exists.
-
#reverse_item ⇒ Object
Returns one Topic which has this String as item identifer or nil if no such Topic exists.
-
#reverse_locators ⇒ Object
Returns the Topic which has this String as subject locator or nil if no such Topic exists.
Methods inherited from Proxy
Constructor Details
This class inherits a constructor from RTM::Axes::Proxy
Instance Method Details
#reverse_atomify ⇒ Object
Returns all Names and Occurrences which have String as data value. If the String is found as value of a Variant, the parent Name is returned.
The result may be empty.
:call-seq:
reverse_atomify -> Array of Names and Occurrences
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rtm/axes/string.rb', line 18 def reverse_atomify index = @tm.literal_index names = index.getNames(@construct).to_a occs = index.getOccurrences(@construct).to_a variants = index.getVariants(@construct).to_a names2 = variants.map{|v| v.parent} _res = names + occs + names2 #could be empty _res = _res.map{|r| r.axes} _res.extend(Characteristics) end |
#reverse_indicators ⇒ Object
Returns the Topic which has this String as indicator (subject identifier) or nil if no such Topic exists.
:call-seq:
reverse_indicators -> Topic or nil
37 38 39 40 41 |
# File 'lib/rtm/axes/string.rb', line 37 def reverse_indicators _res = @tm.get_topic_by_subject_identifier(@construct) #Topic or nil _res = RTM::Axes::Topic.new(_res,@tm) if _res return _res end |
#reverse_item ⇒ Object
Returns one Topic which has this String as item identifer or nil if no such Topic exists.
:call-seq:
reverse_item -> Topic or nil
51 52 53 54 55 56 57 58 59 |
# File 'lib/rtm/axes/string.rb', line 51 def reverse_item _res = @tm.get_construct_by_item_identifier(@construct) #Construct or nil TODO -> Topic return nil unless _res if _res.is_a?(RTM::Topic) return RTM::Axes::Topic.new(_res,@tm) else return nil end end |
#reverse_locators ⇒ Object
Returns the Topic which has this String as subject locator or nil if no such Topic exists.
:call-seq:
reverse_locators -> Topic or nil
69 70 71 72 73 |
# File 'lib/rtm/axes/string.rb', line 69 def reverse_locators _res = @tm.get_topic_by_subject_locator(@construct) #Topic or nil _res = RTM::Axes::Topic.new(_res,@tm) if _res return _res #RTM::Axes::Topic or nil end |