Mercurial > repos > other > SevenLanguagesInSevenWeeks
changeset 7:b8f4577db289
Add "false" and "true" to our OBJECT ALL THINGS list
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Mon, 02 Jan 2017 20:56:04 +0000 |
parents | a50d2fac49ce |
children | 700c167cad9f |
files | 1-Ruby/object-all-things-2-irb.output 1-Ruby/object-all-things-2-ruby.output 1-Ruby/object-all-things-2.rb |
diffstat | 3 files changed, 240 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/1-Ruby/object-all-things-2-irb.output Mon Jan 02 20:45:34 2017 +0000 +++ b/1-Ruby/object-all-things-2-irb.output Mon Jan 02 20:56:04 2017 +0000 @@ -1,7 +1,7 @@ object-all-things-2.rb(main):001:0> #! /usr/bin/env ruby object-all-things-2.rb(main):002:0* -object-all-things-2.rb(main):003:0* objects = [ 4, 3.14, 'Pi', 'π'] -=> [4, 3.14, "Pi", "π"] +object-all-things-2.rb(main):003:0* objects = [ 4, 3.14, 'Pi', 'π', false, true ] +=> [4, 3.14, "Pi", "π", false, true] object-all-things-2.rb(main):004:0> objects.each { |obj| object-all-things-2.rb(main):005:1* puts "#{obj} (#{obj.class})" object-all-things-2.rb(main):006:1> obj.methods.each { |method| puts " #{method}" } @@ -579,5 +579,123 @@ instance_exec __send__ __id__ -=> [4, 3.14, "Pi", "π"] +false (FalseClass) + to_s + inspect + & + | + ^ + nil? + === + =~ + !~ + eql? + hash + <=> + class + singleton_class + clone + dup + taint + tainted? + untaint + untrust + untrusted? + trust + freeze + frozen? + methods + singleton_methods + protected_methods + private_methods + public_methods + instance_variables + instance_variable_get + instance_variable_set + instance_variable_defined? + remove_instance_variable + instance_of? + kind_of? + is_a? + tap + send + public_send + respond_to? + extend + display + method + public_method + singleton_method + define_singleton_method + object_id + to_enum + enum_for + == + equal? + ! + != + instance_eval + instance_exec + __send__ + __id__ +true (TrueClass) + to_s + inspect + & + | + ^ + nil? + === + =~ + !~ + eql? + hash + <=> + class + singleton_class + clone + dup + taint + tainted? + untaint + untrust + untrusted? + trust + freeze + frozen? + methods + singleton_methods + protected_methods + private_methods + public_methods + instance_variables + instance_variable_get + instance_variable_set + instance_variable_defined? + remove_instance_variable + instance_of? + kind_of? + is_a? + tap + send + public_send + respond_to? + extend + display + method + public_method + singleton_method + define_singleton_method + object_id + to_enum + enum_for + == + equal? + ! + != + instance_eval + instance_exec + __send__ + __id__ +=> [4, 3.14, "Pi", "π", false, true] object-all-things-2.rb(main):008:0>
--- a/1-Ruby/object-all-things-2-ruby.output Mon Jan 02 20:45:34 2017 +0000 +++ b/1-Ruby/object-all-things-2-ruby.output Mon Jan 02 20:56:04 2017 +0000 @@ -571,3 +571,121 @@ instance_exec __send__ __id__ +false (FalseClass) + to_s + inspect + & + | + ^ + nil? + === + =~ + !~ + eql? + hash + <=> + class + singleton_class + clone + dup + taint + tainted? + untaint + untrust + untrusted? + trust + freeze + frozen? + methods + singleton_methods + protected_methods + private_methods + public_methods + instance_variables + instance_variable_get + instance_variable_set + instance_variable_defined? + remove_instance_variable + instance_of? + kind_of? + is_a? + tap + send + public_send + respond_to? + extend + display + method + public_method + singleton_method + define_singleton_method + object_id + to_enum + enum_for + == + equal? + ! + != + instance_eval + instance_exec + __send__ + __id__ +true (TrueClass) + to_s + inspect + & + | + ^ + nil? + === + =~ + !~ + eql? + hash + <=> + class + singleton_class + clone + dup + taint + tainted? + untaint + untrust + untrusted? + trust + freeze + frozen? + methods + singleton_methods + protected_methods + private_methods + public_methods + instance_variables + instance_variable_get + instance_variable_set + instance_variable_defined? + remove_instance_variable + instance_of? + kind_of? + is_a? + tap + send + public_send + respond_to? + extend + display + method + public_method + singleton_method + define_singleton_method + object_id + to_enum + enum_for + == + equal? + ! + != + instance_eval + instance_exec + __send__ + __id__
--- a/1-Ruby/object-all-things-2.rb Mon Jan 02 20:45:34 2017 +0000 +++ b/1-Ruby/object-all-things-2.rb Mon Jan 02 20:56:04 2017 +0000 @@ -1,6 +1,6 @@ #! /usr/bin/env ruby -objects = [ 4, 3.14, 'Pi', 'π'] +objects = [ 4, 3.14, 'Pi', 'π', false, true ] objects.each { |obj| puts "#{obj} (#{obj.class})" obj.methods.each { |method| puts " #{method}" }