I hereby claim:
- I am vikiann on github.
- I am viki_ann (https://keybase.io/viki_ann) on keybase.
- I have a public key ASBMAMHjBeacXqK08EbrObbZrsu_poZCPBlQK8-4P4AnKAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
What are database tables, column, and rows? What's the purpose of each? | |
Table is a collection of data organized into columns and rows. | |
Rows are usually one record. Usually horizontal. | |
Columns are usually vertical, and contain similar information about multiple records. | |
How's a database similar and different from a spreadsheet? |
def add(*numbers) | |
numbers.sum | |
end | |
def subtract(number, *more_numbers) | |
more_numbers.each do |i| | |
number -= i | |
end | |
number | |
end |
def grab(piece) | |
candies.any? do |candy| | |
if candy.type == piece | |
piece | |
end | |
end | |
end |
Note from Viki: working on exercise 2. I'm on bag.rb. Tests were provided, I'm running bag_test.rb and running into issues on line 90, which is testing my method take in bag.rb starting on line 34.
If you'd like to be walked through the exercise, check out the Objects and Methods workshop on the Jumpstart Lab tutorials site.
Make the tests pass in the following sequence:
class Candy | |
def initialize(candy, *sugar) | |
@candy = candy | |
@sugar = sugar | |
end | |
def type | |
@candy | |
end |