# Copyright (c) 2006, Chris Parsons (chris@edendevelopment.co.uk) # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of Chris Parsons nor the names of its contributors may be # used to endorse or promote products derived from this software without # specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. client_address = 'Test Client, Test Street, Town, County, Postal Code' new_invoice do address client_address code '2006-45' date Time.now work_at 50 do spent 3.on('Morning meeting') spent 0.5.on('Making the Coffee for the boss').on('25th Sep') end expense 25.on('Nice coffee maker') mileage_at 0.40 do drove 150.to('Get the nice coffee maker').on('24th Sep') end end new_invoice do address client_address code '2006-46' date '30th Sep' work_at 50 do spent 12.on('Fretting about boring job') spent 0.5.on('Wasting more time') spent 0.25.on('Writing resignation letter') end end new_invoice do address client_address code '2006-47-with-currencies' date '30th Sep' work_at 50.pounds("\xa3") / hour do spent 12.hours.on('Fretting about boring job') spent 0.5.days.on('Wasting more time') spent 0.25.weeks.on('Writing resignation letter') end end