Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Table
- def initialize(legs)
- @tabletop = []
- @num_legs = legs
- end
- def put_on(something)
- @tabletop.push something
- end
- def look_at
- p @tabletop
- end
- end
- a_table = Table.new(4)
- a_table.put_on 1
- a_table.put_on 2
- p a_table.look_at
Add Comment
Please, Sign In to add comment