PATH:
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
DateTime
U:RDoc::AnyMethod[iI"deconstruct_keys:ETI"DateTime#deconstruct_keys;TF:publico:RDoc::Markup::Document:@parts[ o:RDoc::Markup::Paragraph; [ I"IReturns a hash of the name/value pairs, to use in pattern matching. ;TI"HPossible keys are: <tt>:year</tt>, <tt>:month</tt>, <tt>:day</tt>, ;TI"D<tt>:wday</tt>, <tt>:yday</tt>, <tt>:hour</tt>, <tt>:min</tt>, ;TI";<tt>:sec</tt>, <tt>:sec_fraction</tt>, <tt>:zone</tt>.;To:RDoc::Markup::BlankLine o; ; [I"Possible usages:;T@o:RDoc::Markup::Verbatim; [I",dt = DateTime.new(2022, 10, 5, 13, 30) ;TI" ;TI"Jif d in wday: 1..5, hour: 10..18 # uses deconstruct_keys underneath ;TI" puts "Working time" ;TI" end ;TI"#=> prints "Working time" ;TI" ;TI" case dt ;TI"in year: ...2022 ;TI" puts "too old" ;TI"in month: ..9 ;TI" puts "quarter 1-3" ;TI"in wday: 1..5, month: ;TI", puts "working day in month #{month}" ;TI" end ;TI"*#=> prints "working day in month 10" ;T:@format0o; ; [I"ONote that deconstruction by pattern can also be combined with class check:;T@o;; [I":if d in DateTime(wday: 1..5, hour: 10..18, day: ..7) ;TI"4 puts "Working time, first week of the month" ;TI"end;T; 0: @fileI"ext/date/date_core.c;T:0@omit_headings_from_table_of_contents_below0I"5deconstruct_keys(array_of_names_or_nil) -> hash ;T0[ I" (p1);T@/FI" DateTime;TcRDoc::NormalClass00
[-] commercial-c.ri
[edit]
[-] minute-i.ri
[edit]
[-] jd-c.ri
[edit]
[-] to_s-i.ri
[edit]
[-] to_json-i.ri
[edit]
[-] strptime-c.ri
[edit]
[-] iso8601-i.ri
[edit]
[-] as_json-i.ri
[edit]
[-] rfc2822-c.ri
[edit]
[-] offset-i.ri
[edit]
[-] civil-c.ri
[edit]
[-] new-c.ri
[edit]
[-] second_fraction-i.ri
[edit]
[-] rfc3339-c.ri
[edit]
[-] strftime-i.ri
[edit]
[-] jisx0301-c.ri
[edit]
[-] json_create-c.ri
[edit]
[-] min-i.ri
[edit]
[-] now-c.ri
[edit]
[-] _strptime-c.ri
[edit]
[-] rfc822-c.ri
[edit]
[-] parse-c.ri
[edit]
[-] deconstruct_keys-i.ri
[edit]
[-] second-i.ri
[edit]
[-] xmlschema-i.ri
[edit]
[-] xmlschema-c.ri
[edit]
[+]
..
[-] new_offset-i.ri
[edit]
[-] rfc3339-i.ri
[edit]
[-] cdesc-DateTime.ri
[edit]
[-] jisx0301-i.ri
[edit]
[-] sec-i.ri
[edit]
[-] sec_fraction-i.ri
[edit]
[-] zone-i.ri
[edit]
[-] to_time-i.ri
[edit]
[-] to_datetime-i.ri
[edit]
[-] hour-i.ri
[edit]
[-] ordinal-c.ri
[edit]
[-] httpdate-c.ri
[edit]
[-] iso8601-c.ri
[edit]
[-] to_date-i.ri
[edit]