Sha256: f51f9b06361b3044503533b6b661efed604845e61ebb7a0bfa288397c9ceadf4

Contents?: true

Size: 911 Bytes

Versions: 7

Compression:

Stored size: 911 Bytes

Contents

module Expressir
  module Model
    class Type < ModelElement
      include Identifier

      model_attr_accessor :underlying_type
      model_attr_accessor :where_rules
      model_attr_accessor :informal_propositions

      def initialize(options = {})
        @id = options[:id]
        @remarks = options[:remarks] || []
        @remark_items = options[:remark_items] || []
        @source = options[:source]

        @underlying_type = options[:underlying_type]
        @where_rules = options[:where_rules] || []
        @informal_propositions = options[:informal_propositions] || []

        super
      end

      def enumeration_items
        underlying_type.is_a?(Types::Enumeration) ? underlying_type.items : []
      end

      def children
        [
          *enumeration_items,
          *where_rules,
          *informal_propositions,
          *remark_items
        ]
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
expressir-1.0.0 lib/expressir/model/type.rb
expressir-1.0.0-x86_64-linux lib/expressir/model/type.rb
expressir-1.0.0-x86_64-darwin lib/expressir/model/type.rb
expressir-1.0.0-x86-mingw32 lib/expressir/model/type.rb
expressir-1.0.0-x86-linux lib/expressir/model/type.rb
expressir-1.0.0-x64-mingw32 lib/expressir/model/type.rb
expressir-1.0.0-arm64-darwin lib/expressir/model/type.rb