]>
git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/ruby/red-arrow/lib/arrow/time32-data-type.rb
1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
20 alias_method
:initialize_raw, :initialize
21 private :initialize_raw
23 # Creates a new {Arrow::Time32DataType}.
25 # @overload initialize(unit)
27 # @param unit [Arrow::TimeUnit, Symbol] The unit of the
30 # The unit must be second or millisecond.
32 # @example Create a time32 data type with Arrow::TimeUnit
33 # Arrow::Time32DataType.new(Arrow::TimeUnit::MILLI)
35 # @example Create a time32 data type with Symbol
36 # Arrow::Time32DataType.new(:milli)
38 # @overload initialize(description)
40 # @param description [Hash] The description of the time32 data
41 # type. It must have `:unit` value.
43 # @option description [Arrow::TimeUnit, Symbol] :unit The unit of
44 # the time32 data type.
46 # The unit must be second or millisecond.
48 # @example Create a time32 data type with Arrow::TimeUnit
49 # Arrow::Time32DataType.new(unit: Arrow::TimeUnit::MILLI)
51 # @example Create a time32 data type with Symbol
52 # Arrow::Time32DataType.new(unit: :milli)
56 unit
= description
[:unit]