Module: RTM::Sugar::Topic::Scoped

Defined in:
rtm/lib/rtm/sugar/topic/scoped.rb,
rtm/spec/rtm/sugar/topic/scoped_spec.rb

Instance Method Summary

Instance Method Details

- (Object) scoped

Returns the Associations, Names, Occurrences and Variants whose scope contains this Topic. Beware: The scope of a Variant includes the themes of the Name this Variant belongs to.

:call-seq:

  scoped -> Array of Associations, Names, Occurrences and Variants


14
15
16
17
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 14

def scoped
  _index = scoped_index
  _index.getAssociations(self).to_a + _index.getNames(self).to_a + _index.getOccurrences(self).to_a + _index.getVariants(self).to_a
end

- (Object) scoped_associations

Returns the Associations whose scope contains this Topic.

The result may be empty.

:call-seq:

  scoped_associations -> Collection of Associations


26
27
28
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 26

def scoped_associations
  scoped_index.getAssociations(self)
end

- (Object) scoped_names

Returns the Names whose scope contains this Topic.

The result may be empty.

:call-seq:

  scoped_names -> Collection of Names


37
38
39
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 37

def scoped_names
  scoped_index.getNames(self)
end

- (Object) scoped_occurrences

Returns the Occurrences whose scope contains this Topic.

:call-seq:

  scoped_occurrences -> Collection of Occurrences


46
47
48
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 46

def scoped_occurrences
  scoped_index.getOccurrences(self)
end

- (Object) scoped_variants

Returns the Variants whose scope (including the scope of the parent Name) contains this Topic.

The result may be empty.

:call-seq:

  scoped_variants -> Collection of Variants


58
59
60
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 58

def scoped_variants
  scoped_index.getVariants(self)
end

- (Boolean) used_as_association_theme?

States if this topic occurs as theme in the scope of an Association.

:call-seq:

  used_as_association_theme? -> true or false

Returns:

  • (Boolean)


76
77
78
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 76

def used_as_association_theme?
  not self.scoped_associations.empty?
end

- (Boolean) used_as_name_theme?

States if this topic occurs as theme in the scope of a Name.

:call-seq:

  used_as_name_theme? -> true or false

Returns:

  • (Boolean)


85
86
87
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 85

def used_as_name_theme?
  not self.scoped_names.empty?
end

- (Boolean) used_as_occurrence_theme?

States if this topic occurs as theme in the scope of an Occurrence.

:call-seq:

  used_as_occurrence_theme? -> true or false

Returns:

  • (Boolean)


94
95
96
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 94

def used_as_occurrence_theme?
  not self.scoped_occurrences.empty?
end

- (Boolean) used_as_theme?

States if this topic occurs as theme in the scope of a scoped Construct.

:call-seq:

  used_as_theme? -> true or false

Returns:

  • (Boolean)


67
68
69
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 67

def used_as_theme?
  used_as_name_theme? || used_as_occurrence_theme? || used_as_association_theme? || used_as_variant_theme?
end

- (Boolean) used_as_variant_theme?

States if this topic occurs as theme in the scope of a Variant.

:call-seq:

  used_as_variant_theme? -> true or false

Returns:

  • (Boolean)


103
104
105
# File 'rtm/lib/rtm/sugar/topic/scoped.rb', line 103

def used_as_variant_theme?
  not self.scoped_variants.empty?
end