Class: Book

Inherits:
Object
  • Object
show all
Defined in:
lib/book.rb

Overview

Book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title, rating) ⇒ Book

Returns a new instance of Book.



6
7
8
9
# File 'lib/book.rb', line 6

def initialize(title, rating)
  @title = title
  @rating = rating
end

Instance Attribute Details

#ratingObject (readonly)

Returns the value of attribute rating.



4
5
6
# File 'lib/book.rb', line 4

def rating
  @rating
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/book.rb', line 3

def title
  @title
end