Module: AIPP::NOTAM::Executable

Defined in:
lib/aipp/scopes/notam/executable.rb

Instance Method Summary collapse

Instance Method Details

#guardObject



22
23
24
# File 'lib/aipp/scopes/notam/executable.rb', line 22

def guard
  AIPP.options.effective_at = AIPP.options.effective_at.change(min: 0, sec: 0).utc
end

#option_parser(o) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/aipp/scopes/notam/executable.rb', line 13

def option_parser(o)
  o.banner = <<~END
    Download online NOTAM and convert it to #{AIPP.options.schema.upcase}.
    Usage: #{File.basename($0)} notam [options]
  END
  o.on('-t', '--effective (TIME)', String, %Q[effective at this time (default: "#{AIPP.options.effective_at}")]) { AIPP.options.effective_at = Time.parse(_1) }
  o.on('-x', '--crossload DIR', String, 'crossload directory') { AIPP.options.crossload = Pathname(_1) }
end

#optionsObject



6
7
8
9
10
11
# File 'lib/aipp/scopes/notam/executable.rb', line 6

def options
  AIPP.options.merge(
    module: 'NOTAM',
    effective_at: Time.now.change(min: 0, sec: 0)
  )
end