Hotels Step 1

Reading the CSV into a db, extracting the hotel names from the db, display the names.

@jsteiner @gabebw
Any hints on how? I am at a loss, since there are more than 5 lines needed just to fill the hash from the CSV.

On Jul 16, 2014, at 4:55 PM, Gabe Berke-Williams <notifications@github.com> wrote:

> In hotels/database_reader.rb:
> 
> > +    @filename = file_name
> > +    @hotels = {}
> > +  end
> > +
> > +  def hotel_list
> > +    @hotels.keys
> > +  end
> > +
> > +  def import_hotels
> > +    CSV.foreach(@filename, headers:true) do |row|
> > +      name = row["Hotel"]
> > +      city = row["City"]
> > +      phone_number = row["Phone Number"]
> > +      number_of_singles = row["Number of Singles"]
> > +      number_of_doubles = row["number of Doubles"]
> > +      @hotels[name] = [city, phone_number, number_of_singles, number_of_doubles]
> This is more than 5 lines - what if you extract a class?
> 
> —
> Reply to this email directly or view it on GitHub.
>