BMI

DESCRIPTION:

The Body Mass Index (BMI) Gem is usefull to calculate your BMI from console, and add this gem to your ruby project and use it. See ‘bmi -h’ to read the instructions of usage.

FEATURES/PROBLEMS:

Write in your comand line ‘bmi -w (YourWeight) -b (Your height)’ to calculate your BMI, see ‘bmi -h’ for more features.

SYNOPSIS:

Body Mass Index

Imperial BMI Formula

Bash

$bmi -W 189.597 -B 69.6850

Your body mass index is: 27
You are 9% over your ideal weight
Overweight

Ruby

require 'bmi'
bmi = BMI.new
bmi.weight(189.597,'p')           #Note: bmi.weight(189.597) will be in kilograms 
bmi.height(69.6850,'i')           #Note: bmi.height(69.6850) will be on meters
bmi.calc

Your body mass index is: 27
You are 9% over your ideal weight
Overweight

Methods

determinates

bmi.determinates      # =>"Imperial"

get_imperial

bmi.get_imperial      # => 27.447840253722447

get_prime

bmi.get_prime         # => "9% over your ideal weight"

cases

bmi.cases             # => "Overweight"

error

bmi.error             # => false

get_errors

bmi.get_errors        # => nil

Metric Imperial BMI Formula

Bash

$bmi -w 86 -b 1.77

Your body mass index is: 27
You are 9% over your ideal weight
Overweight

Ruby

require 'bmi'
bmi = BMI.new
bmi.weight(86)                # or bmi.weight(86,'k')
bmi.height(1.77)              # or bmi.height(1.77,'m')
bmi.calc

Your body mass index is: 27
You are 9% over your ideal weight
Overweight

Methods

determinates

bmi.determinates       # =>"Metric"

get_imperial

bmi.get_metric         # => 27.450604870886398

get_prime

bmi.get_prime          # => "9% over your ideal weight"

cases

bmi.cases              # => "Overweight"

error

bmi.error              # => false

get_errors

bmi.get_errors         # => nil

REQUIREMENTS:

Requires ~> ruby-1.9.2-p290

To build this Gem were installed the following gems:

gem install newgem
gem install hoe
gem install rake
gem install rubyforge

INSTALL:

To install this Gem you only need to run:

Gem install bmi

The Gem is uploaded to rubygems.org/

LICENSE:

(The MIT License)

Copyright © 2011 Body Mass Index (BMI)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.