Mercurial > repos > other > SevenLanguagesInSevenWeeks
annotate 1-Ruby/object-all-things-2.rb @ 11:e0a92558400f
Add some truthiness testing
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Jan 2017 21:13:00 +0000 |
parents | b8f4577db289 |
children | 8d46064c9afc |
rev | line source |
---|---|
6
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
1 #! /usr/bin/env ruby |
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 |
7
b8f4577db289
Add "false" and "true" to our OBJECT ALL THINGS list
IBBoard <dev@ibboard.co.uk>
parents:
6
diff
changeset
|
3 objects = [ 4, 3.14, 'Pi', 'π', false, true ] |
6
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 objects.each { |obj| |
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 puts "#{obj} (#{obj.class})" |
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 obj.methods.each { |method| puts " #{method}" } |
a50d2fac49ce
Add some experiments of what different objects are and what functions they have
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 } |