Class: Book
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Library
#authors, #books, #orders, #readers
Instance Method Summary collapse
-
#initialize(title, author) ⇒ Book
constructor
A new instance of Book.
- #to_h ⇒ Object
Methods inherited from Library
#find_author, #find_book, #find_reader, #save_resource
Methods included from LibraryBackupManager
#as_yaml, included, #save_backup
Constructor Details
#initialize(title, author) ⇒ Book
Returns a new instance of Book.
4 5 6 7 |
# File 'lib/book.rb', line 4 def initialize(title, ) @title = title @author = end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
2 3 4 |
# File 'lib/book.rb', line 2 def @author end |
#title ⇒ Object
Returns the value of attribute title.
2 3 4 |
# File 'lib/book.rb', line 2 def title @title end |
Instance Method Details
#to_h ⇒ Object
9 10 11 12 13 14 |
# File 'lib/book.rb', line 9 def to_h { title: title, author: .name } end |