Class: Arrow::Time32DataType

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow/time32-data-type.rb

Instance Method Summary collapse

Constructor Details

#initialize(unit) ⇒ Time32DataType #initialize(description) ⇒ Time32DataType

Creates a new Arrow::Time32DataType.

Overloads:

  • #initialize(unit) ⇒ Time32DataType

    Examples:

    Create a time32 data type with Arrow::TimeUnit

    Arrow::Time32DataType.new(Arrow::TimeUnit::MILLI)

    Create a time32 data type with Symbol

    Arrow::Time32DataType.new(:milli)

    Parameters:

    • unit (Arrow::TimeUnit, Symbol)

      The unit of the time32 data type.

      The unit must be second or millisecond.

  • #initialize(description) ⇒ Time32DataType

    Examples:

    Create a time32 data type with Arrow::TimeUnit

    Arrow::Time32DataType.new(unit: Arrow::TimeUnit::MILLI)

    Create a time32 data type with Symbol

    Arrow::Time32DataType.new(unit: :milli)

    Parameters:

    • description (Hash)

      The description of the time32 data type. It must have ‘:unit` value.

    Options Hash (description):

    • :unit (Arrow::TimeUnit, Symbol)

      The unit of the time32 data type.

      The unit must be second or millisecond.



53
54
55
56
57
58
59
# File 'lib/arrow/time32-data-type.rb', line 53

def initialize(unit)
  if unit.is_a?(Hash)
    description = unit
    unit = description[:unit]
  end
  initialize_raw(unit)
end