Skip to content

diegogaitan/ruby-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample app to show some basic OOP in Ruby

This app generates a sales receipt with taxes for each type of product. The output can be displayed by running the spec receipt_spec.rb

  • The app uses Ruby 1.9.3 and bundler (Gemfile). You need to run “bundle install” to install rSpec gem

  • The spec file is receipt_spec.rb which you can run with: “rspec receipt_spec.rb”

  • The main class is Product which calculates common taxes.

  • There are subclasses of Product to indicate those who don’t need the basic sales tax. They include a module which sets this tax to zero.

  • The Receipt class calculates the output based on elements of LineItem class

About

Sample app to show some basic OOP in Ruby

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages