Guest User

Untitled

a guest
Apr 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. # create Haiku.body attribute
  2. class Haiku
  3.  
  4. attr_reader :body
  5.  
  6. def initialize(options)
  7. @body = options[:body]
  8. end
  9. end
  10.  
  11. # test body attribute
  12. @haiku = Haiku.new(:body => 'This is a test haiku body')
  13.  
  14. # display the haiku body
  15. puts @haiku.body
Add Comment
Please, Sign In to add comment