Module: RTM::Sugar::Topic::Scoped
- Defined in:
- lib/rtm/sugar/topic/scoped.rb
Instance Method Summary collapse
-
#scoped ⇒ Object
Returns the Associations, Names, Occurrences and Variants whose scope contains this Topic.
-
#scoped_associations ⇒ Object
Returns the Associations whose scope contains this Topic.
-
#scoped_names ⇒ Object
Returns the Names whose scope contains this Topic.
-
#scoped_occurrences ⇒ Object
Returns the Occurrences whose scope contains this Topic.
-
#scoped_variants ⇒ Object
Returns the Variants whose scope (including the scope of the parent Name) contains this Topic.
-
#used_as_association_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of an Association.
-
#used_as_name_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a Name.
-
#used_as_occurrence_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of an Occurrence.
-
#used_as_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a scoped Construct.
-
#used_as_variant_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a Variant.
Instance Method Details
#scoped ⇒ Object
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 'lib/rtm/sugar/topic/scoped.rb', line 14 def scoped _index = scoped_index _index.get_associations(self).to_a + _index.get_names(self).to_a + _index.get_occurrences(self).to_a + _index.get_variants(self).to_a end |
#scoped_associations ⇒ Object
Returns the Associations whose scope contains this Topic.
The result may be empty.
:call-seq:
scoped_associations -> Array of Associations
26 27 28 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 26 def scoped_associations scoped_index.get_associations(self).to_a end |
#scoped_names ⇒ Object
Returns the Names whose scope contains this Topic.
The result may be empty.
:call-seq:
scoped_names -> Array of Names
37 38 39 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 37 def scoped_names scoped_index.get_names(self).to_a end |
#scoped_occurrences ⇒ Object
Returns the Occurrences whose scope contains this Topic.
:call-seq:
scoped_occurrences -> Array of Occurrences
46 47 48 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 46 def scoped_occurrences scoped_index.get_occurrences(self).to_a end |
#scoped_variants ⇒ Object
Returns the Variants whose scope (including the scope of the parent Name) contains this Topic.
The result may be empty.
:call-seq:
scoped_variants -> Array of Variants
58 59 60 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 58 def scoped_variants scoped_index.get_variants(self).to_a end |
#used_as_association_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of an Association.
:call-seq:
used_as_association_theme? -> true or false
76 77 78 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 76 def used_as_association_theme? not self.scoped_associations.empty? end |
#used_as_name_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a Name.
:call-seq:
used_as_name_theme? -> true or false
85 86 87 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 85 def used_as_name_theme? not self.scoped_names.empty? end |
#used_as_occurrence_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of an Occurrence.
:call-seq:
used_as_occurrence_theme? -> true or false
94 95 96 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 94 def used_as_occurrence_theme? not self.scoped_occurrences.empty? end |
#used_as_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a scoped Construct.
:call-seq:
used_as_theme? -> true or false
67 68 69 |
# File '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 |
#used_as_variant_theme? ⇒ Boolean
States if this topic occurs as theme in the scope of a Variant.
:call-seq:
used_as_variant_theme? -> true or false
103 104 105 |
# File 'lib/rtm/sugar/topic/scoped.rb', line 103 def used_as_variant_theme? not self.scoped_variants.empty? end |