Class: ClickHouse::Type::ArrayType

Inherits:
BaseType
  • Object
show all
Defined in:
lib/click_house/type/array_type.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subtype) ⇒ ArrayType

Returns a new instance of ArrayType.


8
9
10
# File 'lib/click_house/type/array_type.rb', line 8

def initialize(subtype)
  @subtype = subtype
end

Instance Attribute Details

#subtypeObject (readonly)

Returns the value of attribute subtype


6
7
8
# File 'lib/click_house/type/array_type.rb', line 6

def subtype
  @subtype
end

Instance Method Details

#cast(value) ⇒ Object


12
13
14
# File 'lib/click_house/type/array_type.rb', line 12

def cast(value, *)
  value
end

#serialize(array, *argv) ⇒ Object


16
17
18
19
20
21
22
# File 'lib/click_house/type/array_type.rb', line 16

def serialize(array, *argv)
  return unless array.is_a?(Array)

  array.map do |value|
    subtype.serialize(value, *argv)
  end
end