Previous Reductive Labs, LLC Next

Everything is an object

Yes, everything:

[Class, "a string", 15, File.open("/etc/passwd")].each { |obj|
    puts "'%s' is of type %s" % [obj, obj.class]
}

Produces:

'Class' is of type Class
'a string' is of type String
'15' is of type Fixnum
'#' is of type File
Previous Luke Kanies luke@reductivelabs.com | Index Next