diff 1-Ruby/object-all-things-2.rb @ 6:a50d2fac49ce

Add some experiments of what different objects are and what functions they have
author IBBoard <dev@ibboard.co.uk>
date Mon, 02 Jan 2017 20:45:34 +0000
parents
children b8f4577db289
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/1-Ruby/object-all-things-2.rb	Mon Jan 02 20:45:34 2017 +0000
@@ -0,0 +1,7 @@
+#! /usr/bin/env ruby
+
+objects = [ 4, 3.14, 'Pi', 'π']
+objects.each { |obj|
+	puts "#{obj} (#{obj.class})"
+	obj.methods.each { |method| puts "    #{method}" }
+}