Module: Fugit::Duration::IsoParser
- Includes:
- Raabro
- Defined in:
- lib/fugit/duration.rb
Instance Method Summary collapse
- #date(i) ⇒ Object
- #day(i) ⇒ Object
- #delt(i) ⇒ Object
- #dur(i) ⇒ Object
- #hou(i) ⇒ Object
- #min(i) ⇒ Object
- #mon(i) ⇒ Object
-
#p(i) ⇒ Object
piece parsers bottom to top.
-
#rewrite_dur(t) ⇒ Object
rewrite parsed tree.
- #sec(i) ⇒ Object
- #t(i) ⇒ Object
- #t_time(i) ⇒ Object
- #telt(i) ⇒ Object
- #time(i) ⇒ Object
- #wee(i) ⇒ Object
- #yea(i) ⇒ Object
Instance Method Details
#date(i) ⇒ Object
392 |
# File 'lib/fugit/duration.rb', line 392 def date(i); rep(nil, i, :delt, 1); end |
#day(i) ⇒ Object
384 |
# File 'lib/fugit/duration.rb', line 384 def day(i); rex(:day, i, /-?\d+D/); end |
#delt(i) ⇒ Object
389 |
# File 'lib/fugit/duration.rb', line 389 def delt(i); alt(nil, i, :yea, :mon, :wee, :day); end |
#dur(i) ⇒ Object
396 |
# File 'lib/fugit/duration.rb', line 396 def dur(i); seq(:dur, i, :p, :date, '?', :t_time, '?'); end |
#hou(i) ⇒ Object
385 |
# File 'lib/fugit/duration.rb', line 385 def hou(i); rex(:hou, i, /-?\d+H/); end |
#min(i) ⇒ Object
386 |
# File 'lib/fugit/duration.rb', line 386 def min(i); rex(:min, i, /-?\d+M/); end |
#mon(i) ⇒ Object
382 |
# File 'lib/fugit/duration.rb', line 382 def mon(i); rex(:mon, i, /-?\d+M/); end |
#p(i) ⇒ Object
piece parsers bottom to top
378 |
# File 'lib/fugit/duration.rb', line 378 def p(i); rex(nil, i, /P/); end |
#rewrite_dur(t) ⇒ Object
rewrite parsed tree
400 |
# File 'lib/fugit/duration.rb', line 400 def rewrite_dur(t); Fugit::Duration.common_rewrite_dur(t); end |
#sec(i) ⇒ Object
387 |
# File 'lib/fugit/duration.rb', line 387 def sec(i); rex(:sec, i, /-?(\d*\.)?\d+S/); end |
#t(i) ⇒ Object
379 |
# File 'lib/fugit/duration.rb', line 379 def t(i); rex(nil, i, /T/); end |
#t_time(i) ⇒ Object
394 |
# File 'lib/fugit/duration.rb', line 394 def t_time(i); seq(nil, i, :t, :time); end |
#telt(i) ⇒ Object
390 |
# File 'lib/fugit/duration.rb', line 390 def telt(i); alt(nil, i, :hou, :min, :sec); end |
#time(i) ⇒ Object
393 |
# File 'lib/fugit/duration.rb', line 393 def time(i); rep(nil, i, :telt, 1); end |
#wee(i) ⇒ Object
383 |
# File 'lib/fugit/duration.rb', line 383 def wee(i); rex(:wee, i, /-?\d+W/); end |
#yea(i) ⇒ Object
381 |
# File 'lib/fugit/duration.rb', line 381 def yea(i); rex(:yea, i, /-?\d+Y/); end |