Sha256: 3eeef20b2fee584dcc6284b0188ca272697651ea3a8282a444ba028653aae620

Contents?: true

Size: 1.1 KB

Versions: 6

Compression:

Stored size: 1.1 KB

Contents

module RTM
  module Validation

    module Association
      def valid?
        return false unless parent
        return false unless type
        return false if roles.empty?
        true
      end
    end

    module AssociationRole
      def valid?
        return false unless player
        return false unless type
        return false unless parent
        true
      end
    end

    module Occurrence
      def valid?
        return false unless type
        return false unless parent
        true
      end
    end

    module Topic
      def valid?
        return false if item_identifiers.empty? && subject_identifiers.empty? && subject_locators.empty?
        true
      end
    end

    module TopicMap
    end

    module TopicName
    end

    module Variant
      def valid?
        return false if scope.empty?
        return false if parent.scope.size == scope.size
        parent.scope.each do |t|
          return false unless scope.include?(t)
        end
        true
      end
    end
    module TopicMapConstruct
      def valid?
        true
      end
    end
    RTM.register_extension( self )
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rtm-0.1.1 lib/rtm/validation.rb
rtm-0.1.3 lib/rtm/validation.rb
rtm-0.1.4 lib/rtm/validation.rb
rtm-0.1.0 lib/rtm/validation.rb
rtm-0.1.5 lib/rtm/validation.rb
rtm-0.1.6 lib/rtm/validation.rb