Class: NycWorkspaceFinder::CLI
- Inherits:
-
Object
- Object
- NycWorkspaceFinder::CLI
- Defined in:
- lib/nyc_workspace_finder/cli.rb
Instance Method Summary collapse
- #again ⇒ Object
- #brooklyn_workspace_data ⇒ Object
- #call ⇒ Object
- #manhattan_or_brooklyn ⇒ Object
- #manhattan_workspace_data ⇒ Object
- #start ⇒ Object
Instance Method Details
#again ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/nyc_workspace_finder/cli.rb', line 56 def again puts "" puts "--------------------------------------" puts "Would you like to see more workspaces?" input = gets.strip.downcase if input == "yes" puts "----------------------" puts "Manhattan or Brooklyn?" puts "----------------------" @input = gets.strip manhattan_or_brooklyn else puts "" puts "Check back later for new workspace options!" end end |
#brooklyn_workspace_data ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/nyc_workspace_finder/cli.rb', line 48 def brooklyn_workspace_data if @workspace == "1" NycWorkspaceFinder::Data.no_space_data elsif @workspace == "2" NycWorkspaceFinder::Data.brooklyn_creative_league_data end end |
#call ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/nyc_workspace_finder/cli.rb', line 2 def call puts "-------------------------------------------------------------------------------------------------------------------------------" puts "WELCOME TO NYC WORKSPACE FINDER. PROVIDING UP-TO-DATE PRICING INFO ON UNIQUE, ART OR PUNK-ORIENTED WORKSPACES IN NEW YORK CITY!" puts "-------------------------------------------------------------------------------------------------------------------------------" puts "" start manhattan_or_brooklyn end |
#manhattan_or_brooklyn ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/nyc_workspace_finder/cli.rb', line 16 def manhattan_or_brooklyn if @input == "manhattan" puts "-------------------------------------------------------------------------------------" puts "Please choose a workspace by number below to find out more about its pricing options." puts "-------------------------------------------------------------------------------------" puts "" puts "1. THE PRODUCTIVE -- 38th St." puts "2. CON ARTIST -- Lower East Side" @workspace = gets.strip manhattan_workspace_data again elsif @input == "brooklyn" puts "-------------------------------------------------------------------------------------" puts "Please choose a workspace by number below to find out more about its pricing options." puts "-------------------------------------------------------------------------------------" puts "" puts "1. NO SPACE -- Greenpoint" puts "2. BROOKLYN CREATIVE LOUNGE -- Gowanus" @workspace = gets.strip brooklyn_workspace_data again end end |
#manhattan_workspace_data ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/nyc_workspace_finder/cli.rb', line 40 def manhattan_workspace_data if @workspace == "1" NycWorkspaceFinder::Data.productive_data elsif @workspace == "2" NycWorkspaceFinder::Data.con_artist_data end end |
#start ⇒ Object
11 12 13 14 |
# File 'lib/nyc_workspace_finder/cli.rb', line 11 def start puts "Are you looking for a workspace in Manhattan or Brooklyn?" @input = gets.strip.downcase end |