Project

egg_carton

0.0
No commit activity in last 3 years
No release in over 3 years
Egg Carton is a series of Ruby number helpers to help with reporting conversions and click-throughs.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Egg Carton Gem

Egg Carton is a series of Ruby number helpers to help with reporting conversions and click-throughs.

Don't put all your eggs in one basket...

Usage

gem install egg_carton

Helpers

The helper methods use a pre-calculate numberator and denominator with the goal of calculating an average or conversion. In many cases, counts are pulled from a database and then need to be displayed properly for reporting. These methods help with the display portion once the values have been calculated.

In Rails, helper methods are added to ActionView::Base, and as a result, available to views.

Average Method

average(1, 4)

# => 0.25

average(1, 4, 1)

# => 0.3

Conversion Method

conversion(1, 4, 2)

# => "25%"

conversion(1, 4, 2, :percentage => false)

# => 0.25

conversion(1, 4, 1)

# => "30%"

conversion(1, 4, 1, :percentage => false)

# => 0.3

Released under the MIT license.