Skip to content

Commit

Permalink
Make requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sumairq committed Apr 22, 2022
1 parent aab92d9 commit 97e5390
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ def start
private

def menu
until @num < 7 && @num.positive?
puts "Please choose an option by entering a number\n1- List all books\n2- List all people\n3- Create a person
puts "Please choose an option by entering a number\n1- List all books\n2- List all people\n3- Create a person
4- Create a book\n5- Create a rental\n6- List all rentals\n7- exit"
@num = gets.chomp.to_i
end
@num = gets.chomp.to_i

case @num.to_i
when 1 then list_books_flow
when 2 then list_people_flow
Expand Down
4 changes: 2 additions & 2 deletions student.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require_relative 'person'

attr_reader :classroom

class Student < Person
attr_reader :classroom

def initialize(classroom, age, name = 'unknown', parent_permission: true)
super(age, name, parent_permission: parent_permission)
@classroom = classroom
Expand Down
2 changes: 2 additions & 0 deletions teacher.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative 'person'

class Teacher < Person
attr_reader :specialization

def initialize(specialization, age, name = 'unknown', parent_permission: true)
super(age, name, parent_permission: parent_permission)
@specialization = specialization
Expand Down

0 comments on commit 97e5390

Please sign in to comment.