Class: Date

Inherits:
Object
  • Object
show all
Defined in:
lib/support.rb

Overview

We are defining to_tg methods for Strings, Date and DateTiem objects. Strings are converted to the time format.

Instance Method Summary collapse

Instance Method Details

#to_tgObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/support.rb', line 5

def to_tg
# old method performed queries
# Date.today.to_tg
# INFO->select from tg_jahr where value = 2019
# INFO->select  expand (out_tg_month_of.in[value = 4]) from #117:0  
# INFO->select  expand (out_tg_day_of.in[value = 2]) from #108:6  
# 
# the alternative:
#    TG::Jahr[year].monat(month).tag(day).orient_flatten
# which can be combined through
#		query "select  expand (out_tg_day_of.in[value = #{day}]) from (select  expand (out_tg_month_of.in[value = #{month}]) from (select from tg_jahr where value = #{year} ) ) "
#
# this is realized in fetch
TG::Tag.fetch self
end