Sha256: 100f450c71c9756025f2f6df13eaa62d28d4ba69fc370f35bfc3675535190100
Contents?: true
Size: 487 Bytes
Versions: 2
Compression:
Stored size: 487 Bytes
Contents
require 'interactor' require_relative '../planet' module SpaceshipMissionSimulator class IdentifyPlanet include Interactor before { permit_gravity_arg! } def call context.planet = Planet.new(gravity: context.gravity).fill_up_data end private def permit_gravity_arg! return true if Planet.known_gravity?(context.gravity) msg = "fail to identify planet with '#{context.gravity}' gravity" context.fail! message: msg end end end
Version data entries
2 entries across 2 versions & 1 rubygems