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.7-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.5-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.5-x86_64-darwin-19 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.5 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.4 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.3 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.2 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.1 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.0 lib/expressir/express/aggregate_dimension.rb
expressir-0.1.0 lib/expressir/express/aggregate_dimension.rb