Sha256: d33ce12cd84abefb1f11ede938230435727d2e0ddc774e62ccb5a6c6976ae765

Contents?: true

Size: 1.76 KB

Versions: 4

Compression:

Stored size: 1.76 KB

Contents

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

module RTM::Axes

  class Characteristic < ItemProxy

    # ---- atomify-axis ------------------------------------------------------#
    
    # Returns the atomic value of the Characteristic.
    #
    # :call-seq:
    #   atomify -> String
    #
    def atomify
      _res = @construct.atomify #String
      RTM::Axes::String.new(_res,@tm)
    end

    # ---- characteristics-axis ----------------------------------------------#
    
    # Returns the Topic this Characteristic belongs to.
    # The optional argument identifier filters the
    # Characteristic for its type. If the type
    # does not match, nil is returned.
    #
    # The identifier may be a topic reference.
    #
    # :call-seq:
    #   reverse_characteristics -> Topic
    #   reverse_characteristics(identifier) -> Topic or nil
    #
    def reverse_characteristics(type=:any)
      _res = @construct.reverse_characteristics(type) #Topic or nil
      RTM::Axes::Topic.new(_res,@tm) if _res
    end

    # ---- reifier-axis ------------------------------------------------------#
    
    
    # Returns the reifing Topic of this Characteristic or nil,
    # if no such Topic exists.
    #
    # :call-seq:
    #   reverse_reified -> Topic or nil
    #
    def reverse_reifier
      _res = @construct.reifier #Topic or nil
      RTM::Axes::Topic.new(_res,@tm) if _res
    end

    # ---- scope-axis --------------------------------------------------------#
    
    # Returns the scope of this Characteristic.
    #
    # The result may be empty.
    #
    # :call-seq:
    #   scope -> Array of Topics
    #
    def scope
      _res = @construct.scope.map{|r| r.axes}
      _res.extend(Topics)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

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