Class: Arrow::Time64DataType

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

Instance Method Summary collapse

Constructor Details

#initialize(unit) ⇒ Time64DataType #initialize(description) ⇒ Time64DataType

Creates a new Arrow::Time64DataType.

Overloads:

  • #initialize(unit) ⇒ Time64DataType

    Examples:

    Create a time64 data type with Arrow::TimeUnit

    Arrow::Time64DataType.new(Arrow::TimeUnit::NANO)

    Create a time64 data type with Symbol

    Arrow::Time64DataType.new(:nano)

    Parameters:

    • unit (Arrow::TimeUnit, Symbol)

      The unit of the time64 data type.

      The unit must be microsecond or nanosecond.

  • #initialize(description) ⇒ Time64DataType

    Examples:

    Create a time64 data type with Arrow::TimeUnit

    Arrow::Time64DataType.new(unit: Arrow::TimeUnit::NANO)

    Create a time64 data type with Symbol

    Arrow::Time64DataType.new(unit: :nano)

    Parameters:

    • description (Hash)

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

    Options Hash (description):

    • :unit (Arrow::TimeUnit, Symbol)

      The unit of the time64 data type.

      The unit must be microsecond or nanosecond.



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

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