Skip to content

Instantly share code, notes, and snippets.

@zakky-dev
Created November 6, 2012 15:03
Show Gist options
  • Save zakky-dev/4025265 to your computer and use it in GitHub Desktop.
Save zakky-dev/4025265 to your computer and use it in GitHub Desktop.
class Book
attr_accessor :title, :page_num
def initialize( title, page_num )
@title = title
@page_num = page_num
end
def title
puts @title
return @title
end
end
book = Book.new( "Learning Ruby", 205 )
puts book.title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment