Class: RTM::AR::LiteralIndex

Inherits:
Index
  • Object
show all
Defined in:
lib/rtm/activerecord/literal_index.rb

Instance Attribute Summary

Attributes inherited from Index

#itopic_map, #topic_map

Instance Method Summary collapse

Methods inherited from Index

#close, #initialize, #isAutoUpdated, #isOpen, #open, #reindex

Constructor Details

This class inherits a constructor from RTM::AR::Index

Instance Method Details

#names(value) ⇒ Object Also known as: getNames



23
24
25
# File 'lib/rtm/activerecord/literal_index.rb', line 23

def names(value)
  Names.wrap(self.itopic_map.names.find(:all,:conditions => ["value = ?", value]))
end

#occurrences(value) ⇒ Object Also known as: getOccurrences



28
29
30
# File 'lib/rtm/activerecord/literal_index.rb', line 28

def occurrences(value)
  Occurrences.wrap(self.itopic_map.occurrences.find(:all,:conditions => ["value = ?", value]))
end

#variants(value) ⇒ Object Also known as: getVariants



33
34
35
# File 'lib/rtm/activerecord/literal_index.rb', line 33

def variants(value)
  Variants.wrap(TMDM::Variant.find(:all,:conditions => ["value = ?", value]).select{|v| v.topic_map == self.itopic_map})
end