Sha256: b7436c43826d03efd8dfb8b774a0653b31eb7009aed61a7f460db537d8bc7094

Contents?: true

Size: 1.74 KB

Versions: 4

Compression:

Stored size: 1.74 KB

Contents

class FortuneTeller::CLI
  def call
    puts "      *       *       *         "
    puts "   *          **            *   "
    puts "      *       ***    *          "
    puts "   WELCONE     ****            "
    puts "     TO          ****       *    "
    puts "    YOUR            ****        "
    puts "   FORTUNE       *    ****"
    puts "   TELLER                ***     "
    puts "           *                 ***"
    puts "    *                              **"
    puts "Do you want to know what your horoscope tells you today??"
    horoscope_list
    puts "**************************************************"
    menu
    puts "**************************************************"
    see_you
  end
  def horoscope_list
    FortuneTeller::HoroscopeScraping.scrape_nypost_horoscope
    @horoscopes=FortuneTeller::Horoscope.all
    @horoscopes.each.with_index(1) do |hs, i|
     puts "#{i}. #{hs.name}"
     puts "  #{hs.date}"
    end
  end
  def menu
    input=nil
    while input != "exit"
      puts "selecte your horoscope enter a number or type exit"
      puts "**************************************************"
      input = gets.strip.downcase
      puts " "
      if input=="list"
       horoscope_list
      elsif input.to_i > 0 && input.to_i <= 12
        puts " Your horoscope today:*** #{@horoscopes[input.to_i-1].content}**"
        puts "**************************************************"
      else
       puts "not included select a number or type list or exit."
       puts"***************************************************"
      end
    end
  end
  def see_you
    puts "Thank you for using our application. See you next time!"
    puts "***     *** "
    puts "*    *    *"
    puts " * BYE!! *"
    puts "  *    *"
    puts "     *"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fortune_teller_iraq-0.1.3 lib/fortune_teller/cli.rb
fortune_teller_iraq-0.1.2 lib/fortune_teller/cli.rb
fortune_teller_iraq-0.1.1 lib/fortune_teller/cli.rb
fortune_teller_iraq-0.1.0 lib/fortune_teller/cli.rb