Module: ExploreMars

Defined in:
lib/explore_mars.rb,
lib/explore_mars/call.rb,
lib/explore_mars/photo.rb,
lib/explore_mars/version.rb,
lib/explore_mars/sol_query.rb,
lib/explore_mars/date_query.rb

Defined Under Namespace

Classes: Call, DateQuery, Photo, SolQuery

Constant Summary collapse

VERSION =
"0.5.2"

Class Method Summary collapse

Class Method Details

.get_by_date(params) ⇒ Object



36
37
38
39
# File 'lib/explore_mars.rb', line 36

def self.get_by_date(params)
  fail "Rover and Date are required" if (params[:rover].blank? || params[:date].blank?)
  DateQuery.new(params[:rover], params[:date], params[:camera]).get
end

.get_by_sol(params) ⇒ Object



31
32
33
34
# File 'lib/explore_mars.rb', line 31

def self.get_by_sol(params)
  fail "Rover and Sol are required" if (params[:rover].blank? || params[:sol].blank?)
  SolQuery.new(params[:rover], params[:sol], params[:camera]).get
end

.helpObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/explore_mars.rb', line 14

def self.help
  puts "- use ExploreMars#get_by_sol(rover: <ROVER>, sol: <SOL>, camera: <CAMERA>) to receive a collection of photos by sol"
  puts "- use ExploreMars#get_by_date(rover: <ROVER>, date: <DATE>, camera: <CAMERA>) to receive a collection of photos by Earth date"
  puts "-- rover argument should be the name of one of NASA's Mars rovers"
  puts "-- sol argument should be a number representing the Martian day on which the photo was taken"
  puts "-- date argument should be a string formmated as yyyy-mm-dd"
  puts "-- camera represents the camera with which it was taken, options are:"
  puts "--- 'FHAZ' (Front Hazard Avoidance Camera)"
  puts "--- 'RHAZ' (Rear Hazard Avoidance Camera)"
  puts "--- 'MAST' (Mast Camera)"
  puts "--- 'CHEMCAM' (Chemistry and Camera Complex)"
  puts "--- 'NAVCAM' (Navigation Camera)"
  puts "--- 'MAHLI' (Mars Hand Lens Imager)"
  puts "--- 'MARDI' (Mars Descent Imager)"
  puts "- ExploreMars::Photo#src will return the source url for the photo"
end