Module: RTM::Navigation::Name

Defined in:
lib/rtm/navigation/name/atomify.rb,
lib/rtm/navigation/name/characteristics.rb

Instance Method Summary collapse

Instance Method Details

#atomifyObject

Returns the atomic value of the Characteristic (Name/Occurrence).

:call-seq:

atomify -> String


13
14
15
# File 'lib/rtm/navigation/name/atomify.rb', line 13

def atomify
  value
end

#reverse_characteristics(type = :any) ⇒ Object

Returns the Topic this Characteristic (Name/Occurrence) belongs to. The optional argument identifier filters the Characteristic for its type. If the type does not match, nil is returned.

The identifier may be a topic reference.

:call-seq:

reverse_characteristics -> Topic
reverse_characteristics(identifier) -> Topic or nil


19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rtm/navigation/name/characteristics.rb', line 19

def reverse_characteristics(type=:any)
  return parent if type == :any
  _topic = topic_map.get(type)
  return nil unless _topic
  #filter the Name/Occurrence for its type:
  if _topic == self.type
    return parent
  else
    return nil
  end
end