Sha256: 750f2bd8178ad165985be1724d69ef90cf44a2102450de7acc87359f76352083

Contents?: true

Size: 802 Bytes

Versions: 14

Compression:

Stored size: 802 Bytes

Contents

module Expressir
  module Model
    class Type < ModelElement
      include Scope
      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, [])
      end

      def children
        items = []
        items.push(*[
          *if @type.instance_of? Expressir::Model::Types::Enumeration
            @type.items
          end
        ])
        items.push(*@where)
        items.push(*@informal_propositions)
        items
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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