Sha256: 43437ba62af9d5c2ba847c4b338e3b48c3c05c568229431ce4f028aff055a7cb

Contents?: true

Size: 748 Bytes

Versions: 28

Compression:

Stored size: 748 Bytes

Contents

module Expressir
  module Model
    class Type < ModelElement
      include Identifier

      attr_accessor :type
      attr_accessor :where
      attr_accessor :informal_propositions

      def initialize(options = {})
        @id = options[:id]
        @remarks = options.fetch(:remarks, [])
        @source = options[:source]

        @type = options[:type]
        @where = options.fetch(:where, [])
        @informal_propositions = options.fetch(:informal_propositions, [])

        super
      end

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

      def children
        [
          *enumeration_items,
          *where,
          *informal_propositions
        ]
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

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