Skip to content

whargrove/tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tracker

Tracker is a simple activity tracking application.

Summary

Activity is tracked via Statements.

Statement

  • A Statement binds the Actor with an Activity.

Actor

  • The model that represents the subject of the statement, e.g. "Ron".

Activity

  • The model that represents the object of the statement, e.g. "went jogging".

Testing

bundle exec rspec ./spec

Usage

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."

About

A simple tracking application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published