Module: Helpers

Defined in:
lib/bowshock/helpers.rb

Class Method Summary collapse

Class Method Details

.getJson(url, type) ⇒ Object



5
6
7
8
# File 'lib/bowshock/helpers.rb', line 5

def getJson(url, type)
  uri = URI url
  return Net::HTTP.get uri
end

.nasa_api_keyObject



11
12
13
# File 'lib/bowshock/helpers.rb', line 11

def nasa_api_key
  ENV["NASA_API_KEY"]
end

.vali_date(date) ⇒ Object



16
17
18
# File 'lib/bowshock/helpers.rb', line 16

def vali_date(date)
  date.gsub! '/', '-'
end

.validate_iso8601(date) ⇒ Object



21
22
23
# File 'lib/bowshock/helpers.rb', line 21

def validate_iso8601(date)
  date.split('T')[0]
end