Class: WorldTides::Commands::Fetch

Inherits:
WorldTides::Command show all
Defined in:
lib/world_tides/commands/fetch.rb

Instance Method Summary collapse

Methods inherited from WorldTides::Command

#command, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which

Constructor Details

#initialize(filename, lon, lat, options) ⇒ Fetch

Returns a new instance of Fetch.



8
9
10
11
12
13
# File 'lib/world_tides/commands/fetch.rb', line 8

def initialize(filename, lon, lat, options)
  @filename = filename
  @lon = lon
  @lat = lat
  @options = options
end

Instance Method Details

#execute(input: $stdin, output: $stdout) ⇒ Object



15
16
17
18
19
# File 'lib/world_tides/commands/fetch.rb', line 15

def execute(input: $stdin, output: $stdout)
  require 'world_tides/api_wrapper'
  APIWrapper.new(lon: @lon, lat: @lat).highs_and_lows_csv(@filename)
  output.puts "OK"
end