Module: RTM::Navigation::Occurrence

Defined in:
rtm/spec/rtm/navigation/occurrence_spec.rb,
rtm/lib/rtm/navigation/occurrence/atomify.rb,
rtm/spec/rtm/navigation/occurrence/atomify_spec.rb,
rtm/lib/rtm/navigation/occurrence/characteristics.rb,
rtm/spec/rtm/navigation/occurrence/characteristics_spec.rb

Instance Method Summary

Instance Method Details

- (Object) atomify

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

:call-seq:

  atomify -> String


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

def atomify
  value
end

- (Object) reverse_characteristics(type = :any)

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 'rtm/lib/rtm/navigation/occurrence/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