Sha256: ae571b476e9ae06ed13cdc6b4f025510ab1a1ad453cf81233b62af1b062a4d8a

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig.
# License:   Apache License, Version 2.0

module RTM::Axes
  module AssocsNamesOccs

    def self.extended(k)
      k.extend ArrayProxy
    end

    def result
      self.map{|i| i.construct}
    end
    alias :tmapi :result

    # ---- reifier-axis ------------------------------------------------------#
    
    # Returns the reifing Topics of these Characteristics and
    # Associations only
    # if such Topics exists.
    #
    # The result may be empty.
    #
    # :call-seq:
    #   reverse_reified -> Array of Topics
    #
    def reverse_reifier
      _res = self.inject([]){|all,containee| all << containee.send(:reverse_reifier)}.flatten
      _res = _res.select{|i| i}
      ### FLAG UNIQUE ###
      _res = _res.map{|i| i.construct}.uniq.map{|i| i.axes}
      ###             ###
      _res.extend(Topics)
    end

    # ---- scope-axis --------------------------------------------------------#
    
    # Returns the scope of these Characteristics
    # and Associations.
    #
    # The result may be empty.
    #
    # :call-seq:
    #   scope -> Array of Topics
    #
    def scope
      _res = self.inject([]){|all,containee| all << containee.send(:scope)}.flatten
      ### FLAG UNIQUE ###
      _res = _res.map{|i| i.construct}.uniq.map{|i| i.axes}
      ###             ###
      _res = _res.extend(Topics)
      _res
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rtm-0.3.1 lib/rtm/axes/assocs_names_occs.rb
rtm-0.3.0 lib/rtm/axes/assocs_names_occs.rb
rtm-0.2.1 lib/rtm/axes/assocs_names_occs.rb
rtm-0.2.0 lib/rtm/axes/assocs_names_occs.rb
rtm-0.2 lib/rtm/axes/assocs_names_occs.rb