Sha256: b95c4c5662b33841e5a134f292c0a897ea257969ac8f5f4df64df7fe6835f69e

Contents?: true

Size: 909 Bytes

Versions: 135

Compression:

Stored size: 909 Bytes

Contents

module Expressir
  module Express
    class AggregateDimension
      attr_accessor :aggrtype, :lower, :upper, :isUnique, :isOptionalArray

      def initialize(options = {})
        @aggrtype = "SET"
        @lower = "0"
        @upper = "?"
        @isUnique = false
        @isOptionalArray = false

        @options = options
      end

      def parse
        document = @options.fetch(:document, nil)
        extract_attributes(document) if document

        self
      end

      def self.parse(document)
        new(document: document).parse
      end

      private

      def extract_attributes(document)
        @aggrtype = document.attributes["type"]
        @lower = document.attributes["lower"]
        @upper = document.attributes["upper"]
        @isUnique = document.attributes["unique"] == "YES"
        @isOptionalArray = document.attributes["optional"] == "YES"
      end
    end
  end
end

Version data entries

135 entries across 135 versions & 1 rubygems

Version Path
expressir-0.2.16-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.16-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.16-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.15-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.14-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.13 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.13-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.13-x86_64-darwin lib/expressir/express/aggregate_dimension.rb