Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, we begin to implement our inventory stock counts.
Code Samples
We set up a couple of helper methods in our Inventoryable
class to keep up with stock counts:
module Inventoryable
def stock_count
@stock_count ||= 0
end
def stock_count=(number)
@stock_count = number
end
def in_stock?
stock_count > 0
end
end
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
anthonybrackner
17,776 Points2 Answers
-
anthonybrackner
17,776 Points2 Answers
-
Clay Turner
3,941 Points1 Answer
-
Erik Nuber
20,629 PointsJust offering link to help understand better Getters/Setters and Virtual Attributes.
Posted by Erik NuberErik Nuber
20,629 Points1 Answer
-
Jasmine Frantz
8,299 Points1 Answer
-
PLUS
kabir k
Courses Plus Student 18,036 Points1 Answer
-
Grace Kelly
33,990 Points1 Answer
-
Kevin Naegele
10,868 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up