Class: FrothyBeer::Beer

Inherits:
Object
  • Object
show all
Defined in:
lib/frothybeer/beer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Beer

Beer hash params: :name :brewery :rating :style :abv (alcohol by volume)



12
13
14
15
16
17
18
# File 'lib/frothybeer/beer.rb', line 12

def initialize(hash)
  @name = hash[:name]
  @brewery = hash[:brewery]
  @rating = hash[:rating]
  @style = hash[:style]
  @abv = hash[:abv]
end

Instance Attribute Details

#abvObject (readonly)

Returns the value of attribute abv.



4
5
6
# File 'lib/frothybeer/beer.rb', line 4

def abv
  @abv
end

#breweryObject (readonly)

Returns the value of attribute brewery.



4
5
6
# File 'lib/frothybeer/beer.rb', line 4

def brewery
  @brewery
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/frothybeer/beer.rb', line 4

def name
  @name
end

#ratingObject (readonly)

Returns the value of attribute rating.



4
5
6
# File 'lib/frothybeer/beer.rb', line 4

def rating
  @rating
end

#styleObject (readonly)

Returns the value of attribute style.



4
5
6
# File 'lib/frothybeer/beer.rb', line 4

def style
  @style
end