Gem to calculate BMI
Add this line to your application's Gemfile:
gem 'bmicalc'
And then execute:
$ bundle
Or install it yourself as:
$ gem install bmicalc
require 'bmicalc'
bmi = Bmicalc.new
bmi.weight = 64 # in KGs
bmi.height = 1.78 # in meters
bmi.result # 20
bmi = Bmicalc.new(round: false)
bmi.weight = 64 # in KGs
bmi.height = 1.78 # in meters
bmi.result # 20.199469763918696
bmi = Bmicalc.new(imperial: false)
bmi.weight = 141 # in pounds
bmi.height = 71 # in inches
bmi.result # 20
- Fork it ( http://github.com/tomkadwill/bmicalc/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request