🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

RubyChangeMaker

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

RubyChangeMaker

bundlerRubyGems.org
Version
1.0.4
Version published
Maintainers
1
Created
Source

Gem Version

Ruby Change Maker

Given a currency amount (assuming US Currency ) expressed as a floating point number ( i.e. 1.25 or 0.75 ) returns that amount expressed as the least amount of change using the least number of bills, coins, or combination of bills and coins.

To use as a gem:

gem install RubyChangeMaker

Then, in your source file:

require 'RubyChangeMaker'

cm = RubyChangeMaker::Change.new
amt = 1.25 # for $1.25, use 0.75 for .75 cents, etc.
dollars, cents = cm.make_change(amt)

To see an example program using the Module, look in this repo's bin/ directory

To work with the source files:

To Run:

cd into bin/ and type: './changemaker' (the file is already chmod'd)

To Run Tests:

(require's cucumber)
cd into root directory ( 'ruby-change-maker/' ), then type: cucumber

NOTES:

  • Source is in lib/rubychangemaker/.
  • lib/rubychangemaker.rb is just some boot-strapping for cucumber.
  • features/support/ again, boot-strapping for cucumber.

FAQs

Package last updated on 24 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts