Class: SnowNasa::Neobjects
- Inherits:
-
Object
- Object
- SnowNasa::Neobjects
- Includes:
- SnowNasa
- Defined in:
- lib/SnowNasa/neobjects.rb
Constant Summary
Constants included from SnowNasa
Instance Attribute Summary
Attributes included from SnowNasa
Class Method Summary collapse
Methods included from SnowNasa
get_nasa_api_key, nasa_api_key
Class Method Details
.getNeo(options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/SnowNasa/neobjects.rb', line 5 def self.getNeo( = {}) start_date = ([:start_date].to_date).strftime("%Y-%m-%d") end_date = ([:end_date].to_date).strftime("%Y-%m-%d") base_url = "https://api.nasa.gov/neo/rest/v1/feed?start_date=#{start_date}&end_date=#{end_date}&api_key=#{@@nasa_api_key}" data = open(base_url).read JSON.parse(data) end |