class OnTapIbc::Beer

Attributes

abv[RW]
addl1[RW]
long_desc[RW]
name[RW]
short_desc[RW]
style[RW]

Public Class Methods

all() click to toggle source
# File lib/on_tap_ibc/beer.rb, line 28
def self.all
  @@all
end
assign_beer(selected_tap) click to toggle source
# File lib/on_tap_ibc/beer.rb, line 15
def self.assign_beer(selected_tap)
  @beer_detail_hash = OnTapIbc::Scraper.beer_details.find{|k, v| k == selected_tap.name.upcase }
    if @beer_detail_hash != nil
      @beer_detail_hash[1].each do |attribute, data|
        selected_tap.send(("#{attribute}="), data)
      end
    end
end
create_from_menu(current_beers) click to toggle source
# File lib/on_tap_ibc/beer.rb, line 11
def self.create_from_menu(current_beers)
  current_beers.each {|beer| self.new(beer)}
end
new(beer_hash) click to toggle source
# File lib/on_tap_ibc/beer.rb, line 6
def initialize(beer_hash)
  beer_hash.each {|key, value| self.send(("#{key}="), value)}
  @@all << self
end

Public Instance Methods

addl1=(addl1) click to toggle source
# File lib/on_tap_ibc/beer.rb, line 24
def addl1=(addl1)
  @addl1 = addl1.split(/(?<=[a-z])(?=[A-Z])/)
end