Created
June 27, 2015 17:10
-
-
Save Fokusnica/41d9de46b96a537def52 to your computer and use it in GitHub Desktop.
Additional practice Edition
This file contains 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 Edition | |
# :book, :year_of_publishing, :number_of_pages | |
attr_writer :book, :year_of_publishing, :number_of_pages | |
attr_reader :book, :year_of_publishing, :number_of_pages | |
def initialize (book = nil, year_of_publishing = nil, number_of_pages = nil) | |
@book =book.to_s | |
@year_of_publishing=year_of_publishing.to_i | |
@number_of_pages = number_of_pages.to_i | |
end | |
def output | |
puts "'#{book}', #{year_of_publishing}, #{number_of_pages} pages" | |
end | |
end | |
#edition1=Edition.new("Pride and Prejudice", 1813, 820) | |
#edition1.output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment