Sha256: e5ce2a180a4b741708bacd4e1eac7f90b7f6bf07e61be2d97c4a0ac3e1fe32c8

Contents?: true

Size: 945 Bytes

Versions: 1

Compression:

Stored size: 945 Bytes

Contents

#change to Brewery
class Brewery

  #change to reflect all brewery attributes
  attr_accessor :name, :street_address, :phone, :id, :overall_score, :selection, :service, :atmosphere, :review_count, :food

  @@all = []

  def initialize(brewery_hash)
    #puts "#{brewery_hash}"
    brewery_hash.each do |key, value|
      #puts "#{key} #{value}"
      self.send(("#{key}="), value)
      #puts "#{self.phone}"

    end
    @@all << self
    #puts "#{@@all}"
  end

  #change students_array to brewery_array
  def self.create_from_collection(brewery_array)
    #puts "#{brewery_array}"
    brewery_array.each_with_index do |brewery_hash, index|
      #Brewery.new
      #puts "#{brewery_hash} #{index}"
      Brewery.new(brewery_hash)
    end
  end

  #change to add_brewery_info, score_hash
  def add_score_info(score_hash)
    score_hash.each do |key, value|
      self.send(("#{key}="), value)
    end
  end

  def self.all
    @@all
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
Brew_Finder-0.1.0 lib/Brew_Finder/brewery_info.rb