Class: CLI
- Inherits:
-
Object
- Object
- CLI
- Defined in:
- lib/cli.rb
Instance Method Summary collapse
-
#call ⇒ Object
attr_accessor :char_id, :name, :birthday, :occupation, :img, :status, :appearance, :nickname, :portrayed.
- #choose_a_character ⇒ Object
- #get_character_details(char) ⇒ Object
- #list_characters ⇒ Object
Instance Method Details
#call ⇒ Object
attr_accessor :char_id, :name, :birthday, :occupation, :img, :status, :appearance, :nickname, :portrayed
5 6 7 8 9 10 |
# File 'lib/cli.rb', line 5 def call API.new.call_api puts "Welcome to the Breaking Bad Character Finder!" choose_a_character end |
#choose_a_character ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cli.rb', line 12 def choose_a_character puts "" puts "Press Enter to view a list of characters." input = gets.strip.to_i list_characters puts "" puts "Type the number of the character for additional information." input = gets.strip.to_i char = Character.find get_character_details(char) end |
#get_character_details(char) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/cli.rb', line 31 def get_character_details(char) Character.name.find do |char, name| puts "" puts "_________#{char.name}____________" puts "#{}" puts "Occupation: #{char.occupation}" puts "img: #{char.img}" puts "Occupation: #{char.occupation}" puts "Nickname: #{char.nickname}" puts "Portrayed: #{char.portrayed}" end end |