Created
November 6, 2012 15:03
-
-
Save zakky-dev/4025265 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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