Please tell me what am I doing wrong here. I want to be able to capitalize any string that is being added later in the code through the method titles
.
class Book
attr_accessor :book_title
def initialize
@book_title = String.new
end
def titles
book_title.capitalize
end
end
@book = Book.new
puts @book.titles = "steve jobs"
Because when I execute it, I get undefined method `titles=' for #<Book:0x007fbd25813d98 @book_title=""> (NoMethodError)