Sha256: fa12d2c82f420b4696d1116332de0a73f81e2917841a7c65dd447ced30436d22

Contents?: true

Size: 734 Bytes

Versions: 4

Compression:

Stored size: 734 Bytes

Contents

# encoding: UTF-8
#
# Copyright (c) 2010-2017 GoodData Corporation. All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

require_relative '../base_type'

module GoodData
  module LCM2
    module Type
      class ArrayType < BaseType
        CATEGORY = :special

        def initialize(type)
          @type = type
        end

        def check(values)
          return false unless values.is_a?(Array)

          values.each do |value|
            return false unless @type.check(value)
          end

          true
        end

        def to_s
          "#{self.class.short_name}<#{@type}>"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gooddata-0.6.53 lib/gooddata/lcm/types/special/array.rb
gooddata-0.6.52 lib/gooddata/lcm/types/special/array.rb
gooddata-0.6.51 lib/gooddata/lcm/types/special/array.rb
gooddata-0.6.50 lib/gooddata/lcm/types/special/array.rb