Tracker is a simple activity tracking application.
Activity is tracked via Statements.
- A Statement binds the Actor with an Activity.
- The model that represents the subject of the statement, e.g. "Ron".
- The model that represents the object of the statement, e.g. "went jogging".
bundle exec rspec ./spec
Create a new Actor
ron = Actor.new(name: 'Ron')
ron.save!
Create a new Activity
jogging = Activity.new(name: 'Jogging', description: 'A new fad')
jogging.save!
Create a Statement with the actor and activity objects
statement = Statement.new(actor: ron, activity: jogging)
statement.save!
Now you can see who did the activity through the Statement
statement.actor.name
=> "Ron"
statement.activity.name
=> "Jogging"
statement.to_s
=> "Ron went jogging."