Class: FrothyBeer::Beer
- Inherits:
-
Object
- Object
- FrothyBeer::Beer
- Defined in:
- lib/frothybeer/beer.rb
Instance Attribute Summary collapse
-
#abv ⇒ Object
readonly
Returns the value of attribute abv.
-
#brewery ⇒ Object
readonly
Returns the value of attribute brewery.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rating ⇒ Object
readonly
Returns the value of attribute rating.
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Beer
constructor
Beer hash params: :name :brewery :rating :style :abv (alcohol by volume).
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
#abv ⇒ Object (readonly)
Returns the value of attribute abv.
4 5 6 |
# File 'lib/frothybeer/beer.rb', line 4 def abv @abv end |
#brewery ⇒ Object (readonly)
Returns the value of attribute brewery.
4 5 6 |
# File 'lib/frothybeer/beer.rb', line 4 def brewery @brewery end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/frothybeer/beer.rb', line 4 def name @name end |
#rating ⇒ Object (readonly)
Returns the value of attribute rating.
4 5 6 |
# File 'lib/frothybeer/beer.rb', line 4 def @rating end |
#style ⇒ Object (readonly)
Returns the value of attribute style.
4 5 6 |
# File 'lib/frothybeer/beer.rb', line 4 def style @style end |