Class: GoodData::LCM2::Type::ArrayType

Inherits:
BaseType show all
Defined in:
lib/gooddata/lcm/types/special/array.rb

Constant Summary collapse

CATEGORY =
:special

Constants included from Dsl::Dsl

Dsl::Dsl::DEFAULT_OPTS, Dsl::Dsl::PARAMS, Dsl::Dsl::TYPES

Instance Method Summary collapse

Methods inherited from BaseType

check_params

Methods included from Dsl::Dsl

#define_params, #define_type, #process

Constructor Details

#initialize(type) ⇒ ArrayType

Returns a new instance of ArrayType.



15
16
17
# File 'lib/gooddata/lcm/types/special/array.rb', line 15

def initialize(type)
  @type = type
end

Instance Method Details

#check(values) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/gooddata/lcm/types/special/array.rb', line 19

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

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

  true
end

#to_sObject



29
30
31
# File 'lib/gooddata/lcm/types/special/array.rb', line 29

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