All pastes #85795 Raw Edit

Mine

public text v1 · immutable
·published 2006-07-12 04:52 UTC
rendered paste body
class Blah
        #define the init method
        def initialize(who, what, when, where)
                @who = who
                @what = what
                @when = when
                @where = where
        end

        #define a NEW to_s msg... for better customization
        def to_s
                "who=#{@who} what=#{@what} when=#{@when} where=#{@where}"
        end

# start large comment section
=begin
        #create methods for external reading imo
        def who
                @who
        end
        def what
                @what
        end
        def when
                @when
        end
        def where
                @where
        end
# end large comment section
=end

        #does the same as above... just a lot better
        #creates methods for external READING
        #while attr_writer allows for WRITING
        attr_reader :who, :what, :when, :where
end