Skip to content

Calculates the date when somebody will be twice the age of somebody else.

License

Notifications You must be signed in to change notification settings

parndt/double_or_nothing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Double Or Nothing

Figure out the exact date when somebody will be twice your age.

Installation

Add this line to your application's Gemfile:

gem 'double_or_nothing'

And then execute:

$ bundle

Or install it yourself as:

$ gem install double_or_nothing

Usage

require 'double_or_nothing'

alice = DoubleOrNothing::Person.new("2000-01-01")
bob = DoubleOrNothing::Person.new("1985-01-01")

DoubleOrNothing::Calculator.new(alice, bob).call
#=> #<Date: 2014-12-31 ((2457023j,0s,0n),+0s,2299161j)>

DoubleOrNothing::Calculator.new(alice, bob).difference
#=> (5478/1)

Web Usage

An example website can be found at https://github.com/parndt/double_or_nothing-web. This is currently running at https://double-or-nothing.herokuapp.com - enjoy!

Contributing

  1. Fork it ( https://github.com/parndt/double_or_nothing/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Calculates the date when somebody will be twice the age of somebody else.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages