Logo
Learn Ruby In Orbit
Menu
Public Planet Blueprints
What's New
Log In
Sign Up
Planet Blueprint #12
Andrew's Code
module PlanetDetails def planet_name "Planet X" end def planet_distance_from_sun "4.2 light years" end def planet_color "Blue" end def planet_atmosphere "Oxygen-rich" end def planet_size "Large" end def planet_rings true end end class TechnologicalPlanet include AI include Robotics include PlanetDetails attr_reader :dominant_technology, :dominant_inhabitants, :name, :distance_from_sun, :color, :atmosphere, :size, :rings def initialize @dominant_technology = dominant_technology @dominant_inhabitants = dominant_inhabitants @name = planet_name @distance_from_sun = planet_distance_from_sun @color = planet_color @atmosphere = planet_atmosphere @size = planet_size @rings = planet_rings end end
Generated Planet