Class: Book

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

Overview

file book.rb Book Class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, rating) ⇒ Book

Returns a new instance of Book.



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

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

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#ratingObject (readonly)

Returns the value of attribute rating.



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

def rating
  @rating
end