#!/usr/local/bin/ruby class Greeter attr_accessor :name def initialize(name = "world") @name = name end def say_hi puts "Hi, #{@name.capitalize}" end def say_bye puts "Bye, #{@name}" end end if __FILE__ == $0 g1 = Greeter.new g1.say_hi g1.say_bye g2 = Greeter.new("django") g2.say_hi() g2.say_bye() printf "%s ", g2.respond_to?("name") puts g2.respond_to?("name=") end