Class: DearInventory::DateTime

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dear_inventory/lib/date_time.rb

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ DateTime

Returns a new instance of DateTime.



9
10
11
# File 'lib/dear_inventory/lib/date_time.rb', line 9

def initialize(date)
  @date = T.let(date, T.any(Date, Time))
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/dear_inventory/lib/date_time.rb', line 14

def to_s
  @date.strftime("%FT%T")
end