Sha256: fadf13d48c1ac1d76e1b9d66489f176b6a72d573cd7ade14943e265edd0c6dea

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

require "lutaml/uml/has_members"
require "lutaml/uml/classifier"
require "lutaml/uml/association"
require "lutaml/uml/top_element_attribute"

module Lutaml
  module Uml
    class Enum < Classifier
      include HasMembers

      attr_reader :attributes,
                  :members,
                  :modifier,
                  :definition,
                  :keyword

      def initialize(attributes = {})
        super
        @keyword = "enumeration"
      end

      def attributes=(value)
        @attributes = value.to_a.map do |attr|
          TopElementAttribute.new(attr)
        end
      end

      def definition=(value)
        @definition = value.to_s
      end

      # TODO: reserved name, change
      def methods
        []
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lutaml-uml-0.2.7 lib/lutaml/uml/enum.rb
lutaml-uml-0.2.6 lib/lutaml/uml/enum.rb
lutaml-uml-0.2.5 lib/lutaml/uml/enum.rb
lutaml-uml-0.2.4 lib/lutaml/uml/enum.rb