lib/spacex/ships.rb in spacex-0.0.7 vs lib/spacex/ships.rb in spacex-1.0.0

- old
+ new

@@ -24,24 +24,10 @@ property 'attempted_landings' property 'missions' property 'url' property 'image' - class << self - def retrieve_all - data = SPACEX::BaseRequest.call_api('ships') - data.get.body.map { |k| SPACEX::Ships.new(k) } - end - - def get(ship_id = nil) - return retrieve_all if ship_id.nil? - - data = SPACEX::BaseRequest.get("ships/#{ship_id}") - SPACEX::Ships.new(data) - end - - def info(ship_id = nil) - get(ship_id) - end + def self.info(ship_id = nil) + SPACEX::BaseRequest.info("ships/#{ship_id}", SPACEX::Ships) end end end