https://github.com/hackvan/objects-belongs-to
https://github.com/hackvan/objects-belongs-to
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hackvan/objects-belongs-to
- Owner: hackvan
- Created: 2018-07-07T01:46:47.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-07T01:46:59.000Z (almost 7 years ago)
- Last Synced: 2025-01-05T17:13:24.482Z (5 months ago)
- Language: Ruby
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ruby Objects Belong To Lab
## Objectives
* Write classes that are related via the "belongs to" relationship.
## Instructions
In this lab, you'll be coding a `Song` and `Artist` class. A song should belong to an artist. You'll also be coding a `Post` and `Author` class. A post should belong to an author.
* Artists should have a name.
* Songs should have a title and belong to an artist. A song should be able to tell you the name of its artist:```ruby
song.artist.name
# => "Beyonce"
```* Posts should have a title and belong to an author. A post should be able to tell you the name of its author:
```ruby
post.author.name
# => "Hillary"
```View Ruby Objects Belong To Lab on Learn.co and start learning to code for free.