From e688c9de4b56b5acffe8e783a92805231095859d Mon Sep 17 00:00:00 2001 From: Wesley Willis Date: Thu, 1 Oct 2015 11:23:47 -0700 Subject: [PATCH] add solar_system_class.rb file --- solar_system_class.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 solar_system_class.rb diff --git a/solar_system_class.rb b/solar_system_class.rb new file mode 100644 index 00000000..f121e1f6 --- /dev/null +++ b/solar_system_class.rb @@ -0,0 +1,19 @@ +class Solar + attr_reader :name, :plan + def initialize(solar_hash) + @name = solar_hash[:name] + @plan = solar_hash[:plan] + + end + + def add_plan(planet) + @plan.push(planet) + end + + def print_out + @plan.each do |sphere| + puts sphere.name + end + end + +end