Sha256: 0d8b8873fec848c4316c1bce8aa1355a01a19c34e3c868e66fc3b0692d3d3d47

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

#
# cim/association.rb - class CIM::Association
#
# A pure-Ruby implementation of the CIM meta model.
#
# Copyright (c) 2010 Klaus Kämpf <kkaempf@suse.de>
#
# Licensed under the Ruby license
#
module CIM
  #
  # An Association is a Class with the :association Qualifier
  #
  # Only such a class can have Reference properties
  #
  class Association < Class
    #
    # Create Association class
    #
    # call-seq:
    #   Association.new("AssocClass")
    #   Association.new("AssocClass", qualifiers)
    #   Association.new("AssocClass", qualifiers, "assoc_class")
    #   Association.new("AssocClass", qualifiers, "assoc_class", "SuperClass")
    #   Association.new("AssocClass", qualifiers, "assoc_class", "SuperClass", features)
    #
    def initialize name, qualifiers = nil, alias_name = nil, superclass = nil, features = nil
      raise "Association needs 'association' qualifier" unless qualifiers.include?(:association, :bool)
      super name, qualifiers, alias_name, superclass, features
    end
    #
    # true if class has associations (association provider)
    #
    def association?
      true
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cim-0.5.0 lib/cim/association.rb