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.10-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.10-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.10-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.10-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.10-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.9-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-x86_64-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-x86_64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-x86-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-x86-linux lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-x64-mingw32 lib/expressir/express/aggregate_dimension.rb
expressir-0.2.8-arm64-darwin lib/expressir/express/aggregate_dimension.rb
expressir-0.2.7 lib/expressir/express/aggregate_dimension.rb