Class: ExploreMars::SolQuery

Inherits:
Call
  • Object
show all
Defined in:
lib/explore_mars/sol_query.rb

Constant Summary

Constants inherited from Call

Call::BASE_URI, Call::CAMERAS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Call

#get

Constructor Details

#initialize(rover, sol, camera = nil) ⇒ SolQuery

Returns a new instance of SolQuery.



4
5
6
7
8
# File 'lib/explore_mars/sol_query.rb', line 4

def initialize(rover, sol, camera=nil)
  @sol = sol
  @camera = camera.to_s.upcase
  @rover = rover
end

Instance Attribute Details

#cameraObject

Returns the value of attribute camera.



3
4
5
# File 'lib/explore_mars/sol_query.rb', line 3

def camera
  @camera
end

#roverObject

Returns the value of attribute rover.



3
4
5
# File 'lib/explore_mars/sol_query.rb', line 3

def rover
  @rover
end

#solObject

Returns the value of attribute sol.



3
4
5
# File 'lib/explore_mars/sol_query.rb', line 3

def sol
  @sol
end

Instance Method Details

#build_uriObject



10
11
12
13
14
15
16
# File 'lib/explore_mars/sol_query.rb', line 10

def build_uri
  if !@camera.empty?
    URI.parse(BASE_URI + "#{@rover}/" + "photos?sol=#{@sol}&camera=#{@camera}")
  else
    URI.parse(BASE_URI + "#{@rover}/" + "photos?sol=#{@sol}")
  end
end