Sha256: 4cc39968502ed790cc4c9e6903454f0439168248bb4394d77809632d5610efe3

Contents?: true

Size: 731 Bytes

Versions: 5

Compression:

Stored size: 731 Bytes

Contents

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

module RTM
  module Navigation 
    module Topic
           
      # Returns all item identifier of this Topic.
      #
      # The result may be empty.
      #
      # :call-seq:
      #   items -> Array of Strings
      #
      def items
        getItemIdentifiers.map{|locator| locator.value}
      end
      
      # Returns one item identifier of this Topic or nil
      # if this Topic has no item identifier.
      #
      # :call-seq:
      #   item -> String or nil
      #   
      def item
        return items.empty? ?  nil : items.sort.first # TODO Which sorting algorithm?
      end
      
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rtm-0.3.1 lib/rtm/navigation/topic/items.rb
rtm-0.3.0 lib/rtm/navigation/topic/items.rb
rtm-0.2.1 lib/rtm/navigation/topic/items.rb
rtm-0.2.0 lib/rtm/navigation/topic/items.rb
rtm-0.2 lib/rtm/navigation/topic/items.rb