Class: Tarantool::Client::Interval

Inherits:
Data
  • Object
show all
Defined in:
tarantool-client/lib/tarantool/client/interval.rb

Overview

A Tarantool datetime.interval; adjust is :none, :excess or :last.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(year: 0, month: 0, week: 0, day: 0, hour: 0, min: 0, sec: 0, nsec: 0, adjust: :none) ⇒ Interval

Returns a new instance of Interval.



7
8
9
10
11
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 7

def initialize(year: 0, month: 0, week: 0, day: 0, hour: 0, min: 0, sec: 0, nsec: 0, adjust: :none)
  units = { year:, month:, week:, day:, hour:, min:, sec:, nsec: }
  validate_units(units)
  super
end

Instance Attribute Details

#adjust ⇒ Object (readonly)

Returns the value of attribute adjust

Returns:

  • (Object) —

    the current value of adjust



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def adjust
  @adjust
end

#day ⇒ Object (readonly)

Returns the value of attribute day

Returns:

  • (Object) —

    the current value of day



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def day
  @day
end

#hour ⇒ Object (readonly)

Returns the value of attribute hour

Returns:

  • (Object) —

    the current value of hour



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def hour
  @hour
end

#min ⇒ Object (readonly)

Returns the value of attribute min

Returns:

  • (Object) —

    the current value of min



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def min
  @min
end

#month ⇒ Object (readonly)

Returns the value of attribute month

Returns:

  • (Object) —

    the current value of month



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def month
  @month
end

#nsec ⇒ Object (readonly)

Returns the value of attribute nsec

Returns:

  • (Object) —

    the current value of nsec



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def nsec
  @nsec
end

#sec ⇒ Object (readonly)

Returns the value of attribute sec

Returns:

  • (Object) —

    the current value of sec



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def sec
  @sec
end

#week ⇒ Object (readonly)

Returns the value of attribute week

Returns:

  • (Object) —

    the current value of week



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def week
  @week
end

#year ⇒ Object (readonly)

Returns the value of attribute year

Returns:

  • (Object) —

    the current value of year



6
7
8
# File 'tarantool-client/lib/tarantool/client/interval.rb', line 6

def year
  @year
end