つまづきすぎてる

#! ruby -Ks
# -*- coding: Windows-31J -*-
require 'date'


class Examplebook
  def initialize( title, author, page, publish_date )
    @title = title
    @author = author
    @page = page
    @publish_date = publish_date
  end

  attr_accessor :title, :author, :page, :publish_date
 
 def to_s
    "#@title, #@author, #@page, #@publish_date"

  end
 
   def toFormattedString( sep = "\n" )
    "書籍名: #{@title}#{sep}著者名: #{@author}#{sep}ページ数: #{@page}ページ#{sep}発刊日: #{@publish_date}#{sep}
  end
end

book_info = Examplebook.new(
 "本",
 "著者",
 1000,
 Date.new( 2010, 8, 20 ))

puts book_info.to_s

puts book_info.toFormattedString
puts book_info.toFormattedString( "/" )

俺はいつも間違えている!!!