Sha256: dc38afecf9c899cad0b19ba4b9048da3982fa45ffbccab357496cb70ff405514

Contents?: true

Size: 1.04 KB

Versions: 135

Compression:

Stored size: 1.04 KB

Contents

require "expressir/express/type"

module Expressir
  module Express
    class TypeAggregate < Type
      attr_accessor :rank, :dimensions
      def initialize(options = {})
        @rank = 0
        @dimensions = []
        @wheres = []
        @selectedBy = []

        super(options)
      end

      private

      def extract_type_attributes(document)
        @name = document.first.attributes["name"].to_s
        @dimensions = document.map do |aggregate|
          Express::AggregateDimension.parse(aggregate)
        end

        @rank = @dimensions.size
        extract_builtintype_attributes(document)
      end

      def extract_builtintype_attributes(document)
        builtin_type = document.xpath("builtintype").first

        if builtin_type
          @isBuiltin = true
          @domain = builtin_type.attributes["type"].to_s
          @width = builtin_type.attributes["width"].to_s
          @fixed = builtin_type.attributes["fixed"] == "YES"
          @precision = builtin_type.attributes["precision"].to_s
        end
      end
    end
  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
expressir-0.2.19-x64-mingw32 lib/expressir/express/type_aggregate.rb
expressir-0.2.19-arm64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.18 lib/expressir/express/type_aggregate.rb
expressir-0.2.18-x86_64-linux lib/expressir/express/type_aggregate.rb
expressir-0.2.18-x86_64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.18-x86-mingw32 lib/expressir/express/type_aggregate.rb
expressir-0.2.18-x86-linux lib/expressir/express/type_aggregate.rb
expressir-0.2.18-x64-mingw32 lib/expressir/express/type_aggregate.rb
expressir-0.2.18-arm64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.17 lib/expressir/express/type_aggregate.rb
expressir-0.2.17-x86_64-linux lib/expressir/express/type_aggregate.rb
expressir-0.2.17-x86_64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.17-x86-mingw32 lib/expressir/express/type_aggregate.rb
expressir-0.2.17-x86-linux lib/expressir/express/type_aggregate.rb
expressir-0.2.17-x64-mingw32 lib/expressir/express/type_aggregate.rb
expressir-0.2.17-arm64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.16 lib/expressir/express/type_aggregate.rb
expressir-0.2.16-x86_64-linux lib/expressir/express/type_aggregate.rb
expressir-0.2.16-x86_64-darwin lib/expressir/express/type_aggregate.rb
expressir-0.2.16-x86-mingw32 lib/expressir/express/type_aggregate.rb