Archive | Tech talk RSS feed for this section

Dreaming in Ruby

23 Mar

class Dreaming

   def initialize(d)
   @dream = d
   @time = "soon"
   end

   def display
   puts "So, your dream is #{@dream} and you want it to happen #{@time}."
   end

   def grant
        if @dream.include? 'writer'
        puts "Don't worry, it will happen."
        else
        puts "Keep on dreaming, hoping and working."
        end
   end

end

my_dream = Dreaming.new "to be a writer"

my_dream.display

my_dream.grant

Outputs:

“So, your dream is to be a writer and you want it to happen soon.”

“Don’t worry, it will happen.”

(Sigh) If only it were that simple…

Advertisements