Sha256: a107255f30ede3e9914c6c152bcb8a2ce5a5c725db6d0e75ce54b866bd806b8c

Contents?: true

Size: 419 Bytes

Versions: 4

Compression:

Stored size: 419 Bytes

Contents

# frozen_string_literal: true

require_relative '../lib/main'
require_relative '../lib/meteoservice'

def meteo
  data = nil
  File.open("#{__dir__}/data.json", encoding: 'utf-8') do |f|
    data = JSON.parse(f.read).invert
  end

  data
end

town = 'Мурманск'

if meteo.key?(town)
  Meteoservice.result(meteo[town])
else
  puts "Города с названием \"#{town}\" не существует..."
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
meteoservice-0.2.7 examples/prediction.rb
meteoservice-0.2.6 examples/prediction.rb
meteoservice-0.2.5 examples/prediction.rb
meteoservice-0.2.4 examples/prediction.rb